Skip to content

Instantly share code, notes, and snippets.

@Jackbennett
Created February 7, 2017 09:34
Show Gist options
  • Save Jackbennett/41cab72229155757db313ee6002d0a08 to your computer and use it in GitHub Desktop.
Save Jackbennett/41cab72229155757db313ee6002d0a08 to your computer and use it in GitHub Desktop.
Convert datetime error
$ get-date -OutVariable sd "6/2/2017 03:58"
06 February 2017 03:58:00
$ $sd | gm
TypeName: System.DateTime
Name MemberType Definition
---- ---------- ----------
Add Method datetime Add(timespan value)
....
$ Get-MessageTrackingLog -Start $sd
Cannot process argument transformation on parameter 'Start'. Cannot convert the "System.Collections.ArrayList" value of type "System.Collections.ArrayList" to type "System.DateTime".
+ CategoryInfo : InvalidData: (:) [Get-MessageTrackingLog], ParameterBindin...mationException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,Get-MessageTrackingLog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment