@@ -73,6 +73,7 @@ function wait_for_vm_to_come_up() {
7373}
7474
7575function get_windows_updates_remaining() {
76+ echo " Checking for updates remaining (via exit code of 'guest.ps')..." >&2
7677 # run powershell command that "exits" with the Count returned by Get-WindowsUpdate
7778 get_update_count_pid=" $( start_powershell_command " exit (([array](Get-WindowsUpdate)).Count)" ) "
7879
@@ -85,10 +86,9 @@ wait_for_vm_to_come_up
8586run_powershell_command_with_logging ' Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force'
8687run_powershell_command_with_logging ' Install-Module -Name PSWindowsUpdate -MinimumVersion 2.1.0.1 -Force'
8788
88- echo " getting update count exit code via guest.ps"
8989updates_remaining=$( get_windows_updates_remaining)
90+ echo " Windows Updates to install: ${updates_remaining} " >&2
9091
91- echo " Windows Updates to install: ${updates_remaining} "
9292while [[ updates_remaining -ne 0 ]]; do
9393 set +e # ignore unreachable agent if the vm just went down for reboot
9494 run_powershell_command_with_logging " Install-WindowsUpdate -AcceptAll -AutoReboot"
@@ -98,12 +98,11 @@ while [[ updates_remaining -ne 0 ]]; do
9898
9999 updates_remaining=
100100 while [[ -z " ${updates_remaining} " ]] ; do
101- echo " Trying to discover how many updates remain..."
102101 set +e # ignore failures here since the vmware tools agent may be down while updates are being applied
103102 updates_remaining=$( get_windows_updates_remaining)
104103 set -e
105104 done
106- echo " Updates remaining: ${updates_remaining} "
105+ echo " Updates remaining: ${updates_remaining} " >&2
107106done
108107
109108remote_hotfix_log_path=" C:\\ hotfix.log"
0 commit comments