Files
coder/agent/usershell/usershell_windows.go
T

16 lines
328 B
Go
Raw Normal View History

2022-02-18 23:13:32 -06:00
package usershell
import "os/exec"
2022-02-18 23:13:32 -06:00
// Get returns the command prompt binary name.
func Get(username string) (string, error) {
_, err := exec.LookPath("pwsh.exe")
if err == nil {
return "pwsh.exe", nil
}
_, err = exec.LookPath("powershell.exe")
if err == nil {
return "powershell.exe", nil
}
2022-02-18 23:13:32 -06:00
return "cmd.exe", nil
}