windows: Treat pwsh
as PowerShell
(#16409)
`pwsh` is the newer version of `PowerShell`, while the one that comes pre-installed on Windows is called `Windows PowerShell` and is an older version. I have no idea why Microsoft dose this and not updated the `Windows Powershell` on Windows. Release Notes: - N/A
This commit is contained in:
parent
1404e328cf
commit
c0ea806afe
1 changed files with 5 additions and 1 deletions
|
@ -886,7 +886,11 @@ fn to_windows_shell_variable(shell_type: WindowsShellType, input: String) -> Str
|
|||
|
||||
#[cfg(target_os = "windows")]
|
||||
fn to_windows_shell_type(shell: &str) -> WindowsShellType {
|
||||
if shell == "powershell" || shell.ends_with("powershell.exe") {
|
||||
if shell == "powershell"
|
||||
|| shell.ends_with("powershell.exe")
|
||||
|| shell == "pwsh"
|
||||
|| shell.ends_with("pwsh.exe")
|
||||
{
|
||||
WindowsShellType::Powershell
|
||||
} else if shell == "cmd" || shell.ends_with("cmd.exe") {
|
||||
WindowsShellType::Cmd
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue