Skip to content

Commit 3dde52b

Browse files
🩹 [Patch]: Make PS5.1 compatible (#6)
## Description - Make PS5.1 compatible, by not using `$IsWindows`. ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [x] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas
1 parent 340f99c commit 3dde52b

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/PATH/public/Get-EnvironmentPath.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
if (-not $AsArray) {
4141
return $environmentPath
4242
}
43-
if ($IsWindows) {
43+
if ([System.Environment]::OSVersion.Platform -eq 'Win32NT') {
4444
$pathSeparator = ';'
4545
} else {
4646
$pathSeparator = ':'

src/PATH/public/Remove-EnvironmentPath.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Please run the command again with elevated rights (Run as Administrator) or prov
104104
}
105105

106106
end {
107-
if ($IsWindows) {
107+
if ([System.Environment]::OSVersion.Platform -eq 'Win32NT') {
108108
$pathSeparator = ';'
109109
} else {
110110
$pathSeparator = ':'

src/PATH/public/Repair-EnvironmentPath.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Please run the command again with elevated rights (Run as Administrator) or prov
9898
}
9999

100100
end {
101-
if ($IsWindows) {
101+
if ([System.Environment]::OSVersion.Platform -eq 'Win32NT') {
102102
$pathSeparator = ';'
103103
} else {
104104
$pathSeparator = ':'

0 commit comments

Comments
 (0)