-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Description
Expected Behavior
PS C:\Users\smistry> Get-AMInstance -Status Running
StartDateTime EndDateTime ConstructType ConstructName AgentName Status
24/01/2022 19:07:02 24/01/2022 19:07:11 Process HeartbeatProcessAgent dlondbbfms71 Running
Actual Behavior
Get-AMInstance
failure : Invalid format of parameter 'range_start'
At C:\Program Files\WindowsPowerShell\Modules\AutomatePS\5.1.0\Functions\Public\Invoke-AMRestMethod.ps1:103 char:13
+ throw "$($tempResult.Result) : $($tempResult.Info)"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (failure : Inval...r 'range_start':String) [], RuntimeException
+ FullyQualifiedErrorId : failure : Invalid format of parameter 'range_start'
Steps to Reproduce the Problem
- Login to pc built on UK timezone
- Install AutomatePS
- Connect to Automate Instance
- Run Get-AMInstance
Specifications
- AutomatePS Version: 5.1.0
- PowerShell Version: PSVersion 5.1.19041.1320
- Automate Version: 11.5.0.94
Note, I found a workaround was to update Format-AMUri to use GetDateTimeFormats()[77] to format the date in yyyy-MM-dd HH:mm:ss format e.g. 2022-01-25 15:13:25
example
if ($PSBoundParameters.ContainsKey("RangeStart")) {
$Parameters += "range_start=$($RangeStart.ToUniversalTime().GetDateTimeFormats()[77])"
}
if ($PSBoundParameters.ContainsKey("RangeEnd")) {
$Parameters += "range_end=$($RangeEnd.ToUniversalTime().GetDateTimeFormats()[77])"
Metadata
Metadata
Assignees
Labels
No labels