Our IT department rolled out an localized (german) version of win7 pro 32.
As a eager powershell user I was very pleased to see that Win7 comes with PowerShell preinstalled.
But then I found out that powerhell, now beeing rolled out with the OS, was also localized. Get-Help returned german help texts. Also the ISE is localized.
I tried to download an english version. The only version I could find was for vista which dows't install under Win7. I couldn't find any Windows7 version.
So can anybody tell me how to install an english version or how to switch the language?
Well you could just copy the language files over from an English version of Powershell. Language definitions are stored in: C:\WINDOWS\system32\WindowsPowerShell\v1.0
Several Text documents and XML files are stored either in that folder or in a localized version eg:
You can just overwrite the files with the English language files which would be the quickest way to resolve your issue.
Hmm, well then you either have to take ownership of the files and hack your way in there. Which I might lead to problems down the road if you decide to upgrade as you will be performing non-supported operations. You could also opt for specifying the culture attribute if you specify that in your PowerShell profile you would be able to use the English language for any PowerShell session on your machine. You will still have to download the en-US files though as I do not think they are currently implemented on your system. Have a look at this article: http://blogs.msdn.com/b/powershell/archive/2006/04/25/583235.aspx
A third alternative would be to change the language of your local machine to match the language you desire for PowerShell, this can be done by downloading the English language pack.
>Hmm, well then you either have to take ownership of the files and hack your way in there.
>Which I might lead to problems down the road if you decide to upgrade as you will be performing non-supported operations.
Thats not a good idea. Our IT department will kill me if they find out. These restricts are for security reasons.
I looked at the blog post. It gave me some ideas. I snatched the englisch resources from a testmachine and copied the to my powershell directory (this isn't restricted by filesystem rights). I changed CurrentCulture to CurrentUICulture since I wanted to change the display language
[System.Threading.Thread]::CurrentThread.CurrentUICulture = "en-US" ; get-help
And it worked! I got englisch help texts!
But when I put it on two lines it doesn't work:
[System.Threading.Thread]::CurrentThread.CurrentUICulture = "en-US" get-help
It seems that PowerShell is create a new thread for each execution. I ran procmon and could see that a new thread is created and terminated for each line :-(
So adding this to my profile won't work.
The docs state that "When a thread is started, its user interface culture is initially determined by using GetUserDefaultUILanguage from the Windows API. ". So the powershell itself needs to set the culture for each thread it creates in order for this to work.
>A third alternative would be to change the language of your local machine to match the language you desire for PowerShell,
>this can be done by downloading the English language pack.
I think this is only avalable for Enterprise/Ultimate Editions?
I think I'll give up. Thanks for all the help.