CSV-Files With Culture

by Aug 25, 2009

In a previous tip, you learned that CSV files use different separators, depending on your culture. While you were unable to select a separator in PowerShell V1, in PowerShell v2 you now can use the new -Delimiter parameter to specify your own. An even better way is to use -UseCulture. This way, PowerShell automatically detects the appropriate delimiter character for your culture and uses it:

Get-Service | Export-CSV $home\services.csv -UseCulture
. "$home\services.csv"

Twitter This Tip! ReTweet this Tip!