Skip to content

Commit

Permalink
Merge pull request #2429 from openshift-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…2409-to-release-4.12

[release-4.12] OCPBUGS-37613: Bypass ExecutionPolicy running commands
  • Loading branch information
openshift-merge-bot[bot] authored Oct 2, 2024
2 parents a454f5b + 99f3dca commit 9b1c730
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/daemon/powershell/powershell.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type commandRunner struct{}

// Run runs the command with the PowerShell on PATH
func (r *commandRunner) Run(cmd string) (string, error) {
out, err := exec.Command("powershell", "/c", cmd).CombinedOutput()
out, err := exec.Command("powershell", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-Command", cmd).CombinedOutput()
if err != nil {
return "", fmt.Errorf("error running command with output %s: %w", string(out), err)
}
Expand Down

0 comments on commit 9b1c730

Please sign in to comment.