diff --git a/CHANGELOG.md b/CHANGELOG.md index 58d4ac9125..3d2099b0b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - **bucket:** Don't check remote URL of non-git buckets ([#4923](https://github.com/ScoopInstaller/Scoop/issues/4923)) - **bucket:** Don't write message OK before bucket is cloned ([#4925](https://github.com/ScoopInstaller/Scoop/issues/4925)) - **scoop-home:** Call `parse_app` for consistency ([#4910](https://github.com/ScoopInstaller/Scoop/issues/4910)) +- **shim:** Remove character replacement in .cmd -> .ps1 shims ([#4910](https://github.com/ScoopInstaller/Scoop/issues/4910)) ## [v0.2.0](https://github.com/ScoopInstaller/Scoop/compare/v0.1.0...v0.2.0) - 2022-05-10 diff --git a/lib/core.ps1 b/lib/core.ps1 index e06b981c02..25137ce62b 100644 --- a/lib/core.ps1 +++ b/lib/core.ps1 @@ -679,19 +679,11 @@ function shim($path, $global, $name, $arg) { @( "@rem $resolved_path", "@echo off", - "setlocal enabledelayedexpansion", - "set args=%*", - ":: replace problem characters in arguments", - "set args=%args:`"='%", - "set args=%args:(=``(%", - "set args=%args:)=``)%", - "set invalid=`"='", - "if !args! == !invalid! ( set args= )", "where /q pwsh.exe", "if %errorlevel% equ 0 (", - " pwsh -noprofile -ex unrestricted -file `"$resolved_path`" $arg %args%", + " pwsh -noprofile -ex unrestricted -file `"$resolved_path`" $arg %*", ") else (", - " powershell -noprofile -ex unrestricted -file `"$resolved_path`" $arg %args%", + " powershell -noprofile -ex unrestricted -file `"$resolved_path`" $arg %*", ")" ) -join "`r`n" | Out-UTF8File "$shim.cmd"