Skip to content

Commit

Permalink
fix(scanner/windows): support when default shell is powershell (futur…
Browse files Browse the repository at this point in the history
  • Loading branch information
MaineK00n authored Feb 2, 2024
1 parent 7e91f5e commit b9ebcf3
Show file tree
Hide file tree
Showing 3 changed files with 153 additions and 129 deletions.
2 changes: 1 addition & 1 deletion scanner/executil.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ func sshExecExternal(c config.ServerInfo, cmdstr string, sudo bool) (result exec
var cmd *ex.Cmd
switch c.Distro.Family {
case constant.Windows:
cmd = ex.Command(sshBinaryPath, append(args, "powershell.exe", "-NoProfile", "-NonInteractive", fmt.Sprintf(`"%s`, cmdstr))...)
cmd = ex.Command(sshBinaryPath, append(args, cmdstr)...)
default:
cmd = ex.Command(sshBinaryPath, append(args, fmt.Sprintf("stty cols 1000; %s", cmdstr))...)
}
Expand Down
Loading

0 comments on commit b9ebcf3

Please sign in to comment.