Files
coder/agent/usershell/usershell_windows.go
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
380 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.
// Deprecated: use SystemEnvInfo.UserShell instead.
2022-02-18 23:13:32 -06:00
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
}