Skip to content

Commit

Permalink
Update install-latest-wsl.ps1
Browse files Browse the repository at this point in the history
microsoft#12282 (comment) The install-latest-wsl.ps1 script cannot parse the operating "System Type" '$systeminfo = & systeminfo | findstr /C:"System Type"' due to language problems. In the Chinese interface environment, "System Type" is the Chinese "系统类型".
  • Loading branch information
Sherry520 authored Nov 17, 2024
1 parent a7eaca8 commit 5fa7886
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions triage/install-latest-wsl.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

# This script downloads and installs the latest version of the WSL MSI package

# Get current language code
$chcp_num = (chcp) -replace '\D+\(\d+)','$1'

# Set language to english
chcp 437

$ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest

Expand Down Expand Up @@ -48,3 +54,6 @@ if ($exitCode -Ne 0)
Write-Host 'Installation complete'

Remove-Item $target -Force

# Restore original language
chcp $chcp_num

0 comments on commit 5fa7886

Please sign in to comment.