I'm loading some CSV data in a powershell script and doing a group and sum on a field. It as such work fine but the sum is not calculated correcty, as it uses wrong culture setting, for some reason. My data use , as separator and not .
I have tried to set the culture, but does not work.
Set-Culture -CultureInfo da-DK;
what can i Do?
To set a Culture for only the scope of a script use
[cultureinfo]::CurrentCulture=Get-Culture -Name da-DK(it starts having effect only for the line after it has been called)But if you are importing from a CSV from a specific Culture then you should use
Import-Csvwith-UseCultureafter setting the culture(obviously
da-DKwould change depending on the culture involved)