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

Skip to content

Commit 5029c11

Browse files
committed
feat(windows): default to powershell v7 over v6 and failback with cmd.exe
1 parent f017548 commit 5029c11

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

agent/usershell/usershell_windows.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import "os/exec"
44

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

0 commit comments

Comments
 (0)