diff --git a/agent/usershell/usershell_windows.go b/agent/usershell/usershell_windows.go index 8ab586743d8b5..e12537bf3a99f 100644 --- a/agent/usershell/usershell_windows.go +++ b/agent/usershell/usershell_windows.go @@ -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 }