MCPcopy Create free account
hub / github.com/linuxkit/linuxkit / poshCmd

Function poshCmd

src/cmd/linuxkit/run_hyperv.go:177–188  ·  view source on GitHub ↗

Execute a powershell command

(args ...string)

Source from the content-addressed store, hash-verified

175
176// Execute a powershell command
177func poshCmd(args ...string) (string, string, error) {
178 args = append([]string{"-NoProfile", "-NonInteractive"}, args...)
179 cmd := exec.Command(powershell, args...)
180 log.Debugf("[POSH]: %s %s", powershell, strings.Join(args, " "))
181
182 var stdout bytes.Buffer
183 var stderr bytes.Buffer
184 cmd.Stdout = &stdout
185 cmd.Stderr = &stderr
186 err := cmd.Run()
187 return stdout.String(), stderr.String(), err
188}
189
190// Perform some sanity checks, and error if failing
191func hypervChecks() {

Callers 3

runHyperVCmdFunction · 0.85
hypervChecksFunction · 0.85
hypervGetSwitchFunction · 0.85

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected