Skip to content

Commit

Permalink
Fix windows powershell script
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham149 committed Mar 29, 2023
1 parent 75a63f8 commit ef226b4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugin/harness/execer.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ func (e *Execer) runShellExecutable(ctx context.Context, out *spec) error {
// when executing powershell scripts -noprofile -noninteractive
path := filepath.Join(e.Source, out.Run.Pwsh.Path)
slog.Debug("execute", slog.String("file", path))
cmd := exec.Command("pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; %s", path)
script := fmt.Sprintf(
"$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; %s", path)
cmd := exec.Command("pwsh", "-Command", script)
return runCmds(ctx, []*exec.Cmd{cmd}, e.Environ, e.Workdir, e.Stdout, e.Stderr)
case "linux", "darwin":
path := filepath.Join(e.Source, out.Run.Bash.Path)
Expand Down

0 comments on commit ef226b4

Please sign in to comment.