Quantcast
Channel: SAPIEN Forums
Viewing all articles
Browse latest Browse all 546

PowerShell Studio • Re: AccountExpirationDate is returned in american format

$
0
0
PowerShell very often reverts back to its American roots. I recall reading somewhere that one of the architects of PowerShell insisted that this was intentional.
I would post a link but it has been a long time ago and cannot find that at the moment. As far as I remember this was done to make sure PowerShell was not tied to a specific locale and makes scripts and code more compatible.
Anyway. You can simply set the locale before you do any date handling, that should fix it.

Try

$Date = Get-Date
[CultureInfo]::CurrentCulture = 'de-DE'
$Date

Statistics: Posted by Alexander Riedel — Tue Feb 13, 2024 1:05 am



Viewing all articles
Browse latest Browse all 546

Trending Articles