aws / aws-tools-for-powershell

The AWS Tools for PowerShell lets developers and administrators manage their AWS services from the PowerShell scripting environment.
Apache License 2.0
239 stars 79 forks source link

Documentation error: Get-IOTSWAssetProperty[Aggregate/ValueHistory] date parameter types are incorrect #223

Closed fedonev closed 2 years ago

fedonev commented 3 years ago

Description

The cmdlet reference docs say that the -EndDate and -StartDate parameters for the IOT Sitewise cmdlets Get-IOTSWAssetPropertyAggregate and Get-IOTSWAssetPropertyValueHistory are "...expressed in seconds in Unix epoch time." However, unlike the equivalent commands in the AWS CLI, the powershell cmdlets fail when passed unix epoch timestamps.

The cmdlets run successfully if the -EndDate and -StartDate parameters are given as ISO8601 strings.

The parameter documentation in the cmdlet reference guide (not on github?) should state the date parameters are "...expressed in seconds in Unix epoch time as ISO8601 strings".

Reproduction Steps

# unix numeric timestamps fail:  Error: "Start date must be before end date."
Get-IOTSWAssetPropertyAggregate -PropertyAlias "Device-002124/temperature" -AggregateType AVERAGE -Resolution 1h -StartDate 1623800000 -EndDate 1623869267

# unix string timestamps fail:    Error: "String '1623800000' was not recognized as a valid DateTime.
Get-IOTSWAssetPropertyAggregate -PropertyAlias "Device-002124/temperature" -AggregateType AVERAGE -Resolution 1h -StartDate "1623800000" -EndDate "1623869267"

# ISO8601 style timestamps succeed:
Get-IOTSWAssetPropertyAggregate -PropertyAlias "Device-002124/temperature" -AggregateType AVERAGE -Resolution 1h -StartDate "2021-06-13T22:00:00+00" -EndDate "2021-06-16T18:47:47+00"

Logs

Environment

Resolution


This is a :bug: bug-report

github-actions[bot] commented 2 years ago

We have noticed this issue has not received attention in 1 year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue.