gavsto/AutomateAPI

Get-AutomateAPIGeneric returns 401

Closed this issue · 1 comments

Hello everyone!

Attempt to use the API after a long time. Calling get-automatecomputer after connecting with an admin account returns 401:

PS C:\Users\Documents\OneDrive> Connect-AutomateAPI
Successfully tested and connected to the Automate REST API. Token will expire at 2021-04-13T13:11:03

PS C:\Users\Documents\OneDrive> Get-AutomateComputer -AllComputers
Get-AutomateAPIGeneric : Failed to perform Invoke-RestMethod to Automate API with error The remote server returned an error: (401) Unauthorized..Exception.Message
At C:\Program Files\WindowsPowerShell\Modules\AutomateAPI\1.1.1\Public\Get-AutomateComputer.ps1:264 char:16

  • ... Return Get-AutomateAPIGeneric -AllResults -Endpoint "computers" ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-AutomateAPIGeneric

Can anyone please advise if I am doing anything incorrect from my end? This used to work until a month ago. Thanks!

Your module is out of date. You have 1.1.1 - the latest is 1.1.4