gavsto/AutomateAPI

Invoke-ControlCommand; Cannot bind argument to parameter 'InputObject' because it is null

Closed this issue · 1 comments

Invoke-ControlCommand -SessionID $SessionID -TimeOut 120000 -MaxLength 10240 -Command "Invoke-WebRequest -UseBasicParsing 'https://bit.ly/ltposh' | Invoke-Expression; Restart-LTService" -PowerShell

This works but spits out the following below every time. Any ideas?

ConvertFrom-Json : Cannot bind argument to parameter 'InputObject' because it is null.
At C:\Program Files\WindowsPowerShell\Modules\AutomateAPI\1.1.1\Public\Invoke-ControlCommand.ps1:149 char:51
+ ...            Write-Error "$(($_.ErrorDetails | ConvertFrom-Json).messag ...
+                                                  ~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [ConvertFrom-Json], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.ConvertFromJsonCommand

Invoke-ControlCommand :
At line:1 char:1
+ Invoke-ControlCommand -SessionID 04f633ff-b408-4592-b216-cfa1f2bf19a8 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-ControlCommand

Sorry for the delay on this. You are either not using a full admin account or you have not done Connect-ControlAPI. Can you try this and re-open if you have the same problem?