Skip to content

Commit eed5153

Browse files
xenugenio
authored andcommitted
make psperl work on non-english windowses
The problem is that (Get-CimInstance Win32_OperatingSystem).OSArchitecture returns "64-bitowy" on a polish Windows. Instead of doing an exact string comparison, let's just check whether the returned value contains "64" or "32".
1 parent a62d600 commit eed5153

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/PSPerl.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class PSPerl {
1919
# Return the operating system's bitness. will be 64 or 32
2020
[int] ArchOS() {
2121
$the_bits = (Get-CimInstance Win32_OperatingSystem).OSArchitecture;
22-
if ($the_bits -eq '64-bit') { return 64; }
23-
elseif ($the_bits -eq '32-bit') { return 32; }
22+
if ($the_bits -match '64') { return 64; }
23+
elseif ($the_bits -match '32') { return 32; }
2424
throw "Invalid OS Architecture? We don't know what to do with a `"$($the_bits)`" architecture";
2525
}
2626

0 commit comments

Comments
 (0)