Skip to content

Commit b84e063

Browse files
committed
CI: update get_powershell_pid_exit_code function
1 parent e6a5ddd commit b84e063

File tree

1 file changed

+6
-3
lines changed
  • ci/tasks/install-windows-updates

1 file changed

+6
-3
lines changed

ci/tasks/install-windows-updates/run.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,15 @@ function get_powershell_pid_exit_code() {
3131

3232
echo "Getting exit code for ${powershell_pid}" >&2
3333
# -X blocks until the guest process exits
34-
govc guest.ps \
34+
json_out=$(
35+
govc guest.ps \
3536
-vm.ipath="${vm_ipath}" \
3637
-l="${vm_username}:${vm_password}" \
3738
-X -json \
38-
-p="${powershell_pid}" \
39-
| tee >&2 | jq '.processInfo[0].exitCode'
39+
-p="${powershell_pid}"
40+
)
41+
echo "${json_out}" >&2
42+
echo "${json_out}"| jq '.processInfo[0].exitCode'
4043
}
4144

4245
function download_remote_file() {

0 commit comments

Comments
 (0)