Skip to content

Commit 7e4acc6

Browse files
committed
CI: rename method for clarity
This change also makes room to replace variable based command invocation with a function.
1 parent cdc50de commit 7e4acc6

File tree

1 file changed

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

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function wait_for_vm_to_come_up() {
3333
set -e
3434
}
3535

36-
function run_pwsh_command_with_govc() {
36+
function run_powershell_command_with_logging() {
3737
command=$1
3838
echo "Running $command"
3939
pid=$(
@@ -45,8 +45,8 @@ function run_pwsh_command_with_govc() {
4545

4646
wait_for_vm_to_come_up
4747

48-
run_pwsh_command_with_govc 'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force'
49-
run_pwsh_command_with_govc 'Install-Module -Name PSWindowsUpdate -MinimumVersion 2.1.0.1 -Force'
48+
run_powershell_command_with_logging 'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force'
49+
run_powershell_command_with_logging 'Install-Module -Name PSWindowsUpdate -MinimumVersion 2.1.0.1 -Force'
5050

5151
returnWindowsUpdateCount="exit (([array](Get-WindowsUpdate)).Count)"
5252
echo "getting update count"
@@ -87,8 +87,8 @@ while [[ updates_remaining -ne 0 ]]; do
8787
echo "Updates remaining: ${updates_remaining}"
8888
done
8989

90-
run_pwsh_command_with_govc "Get-Hotfix > C:\\hotfix.log"
90+
run_powershell_command_with_logging "Get-Hotfix > C:\\hotfix.log"
9191

9292
govc guest.download -l "${vm_username}:${vm_password}" -vm="${vm_ipath}" "C:\\hotfix.log" hotfix-log/hotfixes.log
9393

94-
run_pwsh_command_with_govc "Dism.exe /online /Cleanup-Image /StartComponentCleanup"
94+
run_powershell_command_with_logging "Dism.exe /online /Cleanup-Image /StartComponentCleanup"

0 commit comments

Comments
 (0)