diff --git a/CHANGELOG.md b/CHANGELOG.md index 10131c3632..f331abccdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - **json:** Serialize jsonpath return ([#5921](https://github.com/ScoopInstaller/Scoop/issues/5921)) - **scoop-search:** Catch error of parsing invalid manifest ([#5930](https://github.com/ScoopInstaller/Scoop/issues/5930)) - **autoupdate:** Copy `PSCustomObject`-type properties within `autoupdate` to prevent reference changes ([#5934](https://github.com/ScoopInstaller/Scoop/issues/5934)) +- **system:** Fix `$dir` parameter passing to `Split-PathLikeEnvVar` at `strip_path` with `-Pattern` switch ([#5936](https://github.com/ScoopInstaller/Scoop/issues/5936)) ## [v0.4.1](https://github.com/ScoopInstaller/Scoop/compare/v0.4.0...v0.4.1) - 2024-04-25 diff --git a/lib/system.ps1 b/lib/system.ps1 index affe2c5450..f56ad169db 100644 --- a/lib/system.ps1 +++ b/lib/system.ps1 @@ -162,7 +162,10 @@ function env($name, $global, $val) { function strip_path($orig_path, $dir) { Show-DeprecatedWarning $MyInvocation 'Split-PathLikeEnvVar' - Split-PathLikeEnvVar -Name $dir -Path $orig_path + if ($dir -is [string]) { + $dir = @($dir) + } + Split-PathLikeEnvVar -Pattern $dir -Path $orig_path } function add_first_in_path($dir, $global) {