How to change Powershell script errors to english?

Hi

How can I change Powershell script errors from german to english?
Example:
Error
Thanks in advance
LVL 19
*** Hopeleonie ***IT ManagerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

X_layerCommented:
I assume that you have German Windows.
Look this article and try.
0
footechCommented:
I don't know if there's any way to make this persistent, but what I found is if you have the language packs installed for the desired language, the following works.
With the display language set to English.
PS C:\> [Threading.Thread]::CurrentThread.CurrentUICulture = 'de'; gc jkdd.txt
Get-Content : Der Pfad "C:\jkdd.txt" kann nicht gefunden werden, da er nicht vorhanden ist.
Bei Zeile:1 Zeichen:62
+ [Threading.Thread]::CurrentThread.CurrentUICulture = 'de'; gc <<<<  jkdd.txt
    + CategoryInfo          : ObjectNotFound: (C:\jkdd.txt:String) [Get-Content], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

PS C:\> gc jkdd.txt
Get-Content : Cannot find path 'C:\jkdd.txt' because it does not exist.
At line:1 char:3
+ gc <<<<  jkdd.txt
    + CategoryInfo          : ObjectNotFound: (C:\jkdd.txt:String) [Get-Content], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

Open in new window


With the display language set to Deutsch.
PS C:\> [Threading.Thread]::CurrentThread.CurrentUICulture = 'en-us'; gc jkdd.txt
Get-Content : Cannot find path 'C:\jkdd.txt' because it does not exist.
At line:1 char:65
+ [Threading.Thread]::CurrentThread.CurrentUICulture = 'en-us'; gc <<<<  jkdd.txt
    + CategoryInfo          : ObjectNotFound: (C:\jkdd.txt:String) [Get-Content], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

PS C:\> gc jkdd.txt
Get-Content : Der Pfad "C:\jkdd.txt" kann nicht gefunden werden, da er nicht vorhanden ist.
Bei Zeile:1 Zeichen:3
+ gc <<<<  jkdd.txt
    + CategoryInfo          : ObjectNotFound: (C:\jkdd.txt:String) [Get-Content], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

Open in new window


That seems to only work when the command is on the same line as from what I've read it is reset for each pipeline.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
*** Hopeleonie ***IT ManagerAuthor Commented:
Thanks so much.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.