feat(windows): default to PowerShell v7 over v6 and fallback to cmd.exe (#5053)

This commit is contained in:
Geoffrey Huntley
2022-11-14 15:43:40 +10:00
committed by GitHub
parent f017548a9c
commit cbb1e91372

View File

@@ -4,7 +4,11 @@ import "os/exec"
// Get returns the command prompt binary name.
func Get(username string) (string, error) {
_, err := exec.LookPath("powershell.exe")
_, err := exec.LookPath("pwsh.exe")
if err == nil {
return "pwsh.exe", nil
}
_, err = exec.LookPath("powershell.exe")
if err == nil {
return "powershell.exe", nil
}