Skip to content

Commit 045c036

Browse files
committed
ci: fix start_powershell_command so that $? is accessible
1 parent 665938b commit 045c036

File tree

1 file changed

+5
-13
lines changed
  • ci/tasks/install-windows-updates

1 file changed

+5
-13
lines changed

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

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,11 @@ function start_powershell_command() {
1919
local powershell_command="${1}"
2020

2121
echo "Starting '${powershell_command}'" >&2
22-
pid=$(
23-
govc guest.start \
24-
-vm.ipath="${vm_ipath}" \
25-
-l="${vm_username}:${vm_password}" \
26-
"\\Windows\\System32\\WindowsPowerShell\\V1.0\\powershell.exe" \
27-
"${powershell_command}"
28-
)
29-
30-
if [ -z "${pid}" ]; then
31-
echo "No PID returned when invoking '${powershell_command}'" >&2
32-
fi
33-
34-
echo "${pid}"
22+
govc guest.start \
23+
-vm.ipath="${vm_ipath}" \
24+
-l="${vm_username}:${vm_password}" \
25+
"\\Windows\\System32\\WindowsPowerShell\\V1.0\\powershell.exe" \
26+
"${powershell_command}"
3527
}
3628

3729
function get_powershell_pid_exit_code() {

0 commit comments

Comments
 (0)