Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 40c100c

Browse files
committed
feat(windows): default to PowerShell v7 over v6 and fallback to cmd.exe
1 parent f017548 commit 40c100c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

agent/usershell/usershell_windows.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ import "os/exec"
44

55
// Get returns the command prompt binary name.
66
func Get(username string) (string, error) {
7-
_, err := exec.LookPath("powershell.exe")
7+
_, err := exec.LookPath("pwsh.exe")
8+
if err == nil {
9+
return "pwsh.exe", nil
10+
}
11+
_, err = exec.LookPath("powershell.exe")
812
if err == nil {
913
return "powershell.exe", nil
1014
}

0 commit comments

Comments
 (0)