Quantcast
Channel: Windows Archive - TechOverflow
Viewing all articles
Browse latest Browse all 17

How to make PowerShell output error messages in English

$
0
0

If you want to see a PowerShell output (e.g. an error message) in english instead of your local language, prefix your command by

[Threading.Thread]::CurrentThread.CurrentUICulture = 'en-US';

For example, in order to run to run My-Cmdlet -Arg 1 with output in English instead of your local language, use

[Threading.Thread]::CurrentThread.CurrentUICulture = 'en-US'; My-Cmdlet -Arg 1

[Threading.Thread]::CurrentThread.CurrentUICulture only affects the current command and does not have any effect for other commands. Hence your need to copy the command before each and every command for which you want to see the output in English.

Possibly you also need to install the English help files in order to see more messages in English. In order to do that, run this command in PowerShell as an administrator:

Update-Help -UICulture en-US

 


Viewing all articles
Browse latest Browse all 17

Trending Articles