Quantcast
Channel: Software Communities : Popular Discussions - ActiveRoles
Viewing all articles
Browse latest Browse all 1277

Date formats in ARS - can they be changed

$
0
0

I just noticed, one of my reporting scripts that gets a list of users and exports the data (the data includes the lastlogontimestamp) to a CSV using Export-CSV writes the date in en-US format.  The problem is that even though the server, default user etc are all set to en-GB the date format in still in en-US.  If I run the script natively in powershell on the server it's fine so it looks like the powershell enviroment presented by ARS 6.5 is in en-US only. 

 

Can this be changed? 

 

I already checked that the ARS service account local is en-GB and I've tried forcing the language to en-GB using:

 

[System.Globalization.CultureInfo] $culture = "en-GB"

[System.Threading.Thread]::CurrentThread.CurrentCulture = $culture

[System.Threading.Thread]::CurrentThread.CurrentUICulture = $culture

 

but this has no affect on Export-CSV.

 

and yes I can use a ForEach loop to process and format the date and output to file myself but it's anoying that I can't just use the export-csv cmdlet!


Viewing all articles
Browse latest Browse all 1277

Trending Articles