Force Ingles #35

Open
opened 2 months ago by piper · 0 comments
piper commented 2 months ago

https://stackoverflow.com/questions/19869627/forcing-powershell-errors-output-in-english-on-localized-systems

# example: Set-PowerShellUICulture -Name "en-US"

function Set-PowerShellUICulture {
    param([Parameter(Mandatory=$true)]
          [string]$Name)

    process {
        $culture = [System.Globalization.CultureInfo]::CreateSpecificCulture($Name)

        $assembly = [System.Reflection.Assembly]::Load("System.Management.Automation")
        $type = $assembly.GetType("Microsoft.PowerShell.NativeCultureResolver")
        $field = $type.GetField("m_uiCulture", [Reflection.BindingFlags]::NonPublic -bor [Reflection.BindingFlags]::Static)
        $field.SetValue($null, $culture)
    }
}
https://stackoverflow.com/questions/19869627/forcing-powershell-errors-output-in-english-on-localized-systems ```powershell # example: Set-PowerShellUICulture -Name "en-US" function Set-PowerShellUICulture { param([Parameter(Mandatory=$true)] [string]$Name) process { $culture = [System.Globalization.CultureInfo]::CreateSpecificCulture($Name) $assembly = [System.Reflection.Assembly]::Load("System.Management.Automation") $type = $assembly.GetType("Microsoft.PowerShell.NativeCultureResolver") $field = $type.GetField("m_uiCulture", [Reflection.BindingFlags]::NonPublic -bor [Reflection.BindingFlags]::Static) $field.SetValue($null, $culture) } } ```
This repo is archived. You cannot comment on issues.
No Label
No Milestone
No Assignees
1 Participants
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.