On Windows, powershell and (especially) batch have unusual argument handling rules that are fairly tricky to implement correctly. Therefore, at present, executing powershell and batch scripts is not allowed on Windows and will result in an exception.
Add support for these by constructing safe command lines for these cases.
For batch, since some strings are impossible to pass to batch scripts, there should be extra validation to reject these arguments immediately to avoid user confusion or (worse yet) vulnerability to injection attacks.
Note that it is technically possible to install and use powershell on other operating systems. Nevertheless, the special support should be restricted to Windows. For other operating systems, particularly POSIX-like OSes like MacOS and Linux, the +x file permission bit should be used with an appropriate #! line.
/cc @maxandersen
On Windows, powershell and (especially) batch have unusual argument handling rules that are fairly tricky to implement correctly. Therefore, at present, executing powershell and batch scripts is not allowed on Windows and will result in an exception.
Add support for these by constructing safe command lines for these cases.
For batch, since some strings are impossible to pass to batch scripts, there should be extra validation to reject these arguments immediately to avoid user confusion or (worse yet) vulnerability to injection attacks.
Note that it is technically possible to install and use powershell on other operating systems. Nevertheless, the special support should be restricted to Windows. For other operating systems, particularly POSIX-like OSes like MacOS and Linux, the
+xfile permission bit should be used with an appropriate#!line..bat/.cmd, rejecting any characters which need quoting (Support execution of batch and powershell scripts #432).ps1(Support execution of batch and powershell scripts #432).bat/.cmd(still reject strings that are not quotable; maybe introduce a special flag which indicates that sending quoted arguments to the script is OK i.e. it uses e.g.%~1instead of%1) (Further enhance batch quoting support #434)/cc @maxandersen