1

I am trying to change the culture settings from de-AT to en-US (especially the regional format settings). The whole process has to be documented in a log file. So, I read the current culture using the Get-Culture function and write it into a logging file. Then I change the settings with Set-Culture. If I try to get the updated settings via Get-Culture again, I just get the value before the change. But it seams like the settings has been changed if I check them at the system properties at the control panel of windows. Until I restart PowerShell and run Get-Culture again the changes will be shown.

Is there any way to kind of refresh Get-Culture, running the same Powershell session?

Thanks a lot in advance!

Here is my code.... Note: I am new in PowerShell...

...

#Creating Log-File
New-Item $LOGFILE -Force

#Get current setting
$CULTURE = Get-Culture
Add-Content -Path $LOGFILE -Value "Old Value:  $CULTURE"
Clear-Variable CULTURE

#Change setting
Set-Culture en-US


$CULTURE = Get-Culture
Add-Content -Path $LOGFILE -Value "New Value:   $CULTURE"


oberpiller
  • 33
  • 4
  • 1
    Does this answer your question? [PowerShell - Set-Culture doesn't seem to change anything](https://stackoverflow.com/questions/34260245/powershell-set-culture-doesnt-seem-to-change-anything) – Palle Due Mar 20 '20 at 09:47
  • I'm afraid not. I made sure that i run everything with administrator. I am logged into the system as admin and I run the ISE as well as the scrip itself as admin. – oberpiller Mar 20 '20 at 09:52
  • But it also states that you cannot see the change for an already started session. You need a new one to see the change. – Palle Due Mar 20 '20 at 09:56

0 Answers0