You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
In trying to do a Create-CWConfig function, I ran into this terrible annoyance with the way that CW needs to receive [datetime] via the API. I wrote this little function that helps. Figured it would help you and your users so they didn't bang their head against the same problems I did.
In trying to do a Create-CWConfig function, I ran into this terrible annoyance with the way that CW needs to receive [datetime] via the API. I wrote this little function that helps. Figured it would help you and your users so they didn't bang their head against the same problems I did.
function ConvertTo-CWTime
{
Param
(
[Parameter(Mandatory = $True,Position = 0)]
[datetime]$dateTime
)
$MyTZone = Get-TimeZone
$datetime = "{0:yyyy-MM-ddThh:mm:ssZ}" -f [System.TimeZoneInfo]::ConvertTimeToUtc($dateTime, $MyTZone)
return $datetime
}