From 9c5cf733d90eddf3aa5c858807cad50fe45cf1c6 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov <47745270+al-cheb@users.noreply.github.com> Date: Thu, 30 Sep 2021 20:17:00 +0300 Subject: [PATCH] packer: add pause after windows update (#4192) --- images/win/windows2019.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/images/win/windows2019.json b/images/win/windows2019.json index fe47fea3..7c16c7c7 100644 --- a/images/win/windows2019.json +++ b/images/win/windows2019.json @@ -144,11 +144,12 @@ { "type": "windows-restart", "check_registry": true, - "restart_check_command": "powershell -command \"& {if (-not (Get-Process TiWorker.exe -ErrorAction SilentlyContinue)) { Write-Output 'Restart complete' }}\"", + "restart_check_command": "powershell -command \"& {if ((-not (Get-Process TiWorker.exe -ErrorAction SilentlyContinue)) -and (-not [System.Environment]::HasShutdownStarted) ) { Write-Output 'Restart complete' }}\"", "restart_timeout": "30m" }, { "type": "powershell", + "pause_before": "2m", "scripts": [ "{{ template_dir }}/scripts/Installers/Install-VCRedist.ps1", "{{ template_dir }}/scripts/Installers/Install-Docker.ps1",