MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / buildExecCommand

Function buildExecCommand

internal/cli/guests.go:598–610  ·  view source on GitHub ↗

buildExecCommand wraps a shell command in the appropriate interpreter for the guest OS. Mirrors the logic in internal/plugins/command-runner/executor.go:buildGuestAgentCommand.

(osType, command string)

Source from the content-addressed store, hash-verified

596// the guest OS. Mirrors the logic in
597// internal/plugins/command-runner/executor.go:buildGuestAgentCommand.
598func buildExecCommand(osType, command string) []string {
599 if isWindowsOSType(osType) {
600 return []string{
601 "powershell.exe",
602 "-NoProfile",
603 "-NonInteractive",
604 "-ExecutionPolicy", "Bypass",
605 "-Command", command,
606 }
607 }
608
609 return []string{"/bin/sh", "-c", command}
610}
611
612// isWindowsOSType returns true when the Proxmox ostype string indicates a
613// Windows guest. Mirrors detectOSFamily in

Callers 1

runGuestsExecFunction · 0.85

Calls 1

isWindowsOSTypeFunction · 0.85

Tested by

no test coverage detected