diff --git a/images.CI/build-image.ps1 b/images.CI/build-image.ps1 index 54748e41..24d4a4d5 100644 --- a/images.CI/build-image.ps1 +++ b/images.CI/build-image.ps1 @@ -36,6 +36,9 @@ $SensitiveData = @( ': ->' ) +Write-Host "Show Packer Version" +packer --version + Write-Host "Build $Image VM" packer build -var "capture_name_prefix=$ResourcesNamePrefix" ` -var "client_id=$ClientId" ` diff --git a/images/win/scripts/Installers/Windows2016/Initialize-VM.ps1 b/images/win/scripts/Installers/Windows2016/Initialize-VM.ps1 index 7998f1cb..d9210571 100644 --- a/images/win/scripts/Installers/Windows2016/Initialize-VM.ps1 +++ b/images/win/scripts/Installers/Windows2016/Initialize-VM.ps1 @@ -8,7 +8,13 @@ function Disable-InternetExplorerESC { $UserKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}" Set-ItemProperty -Path $AdminKey -Name "IsInstalled" -Value 0 -Force Set-ItemProperty -Path $UserKey -Name "IsInstalled" -Value 0 -Force - Stop-Process -Name Explorer -Force -ErrorAction Continue + + $ieProcess = Get-Process -Name Explorer -ErrorAction SilentlyContinue + + if ($ieProcess){ + Stop-Process -Name Explorer -Force -ErrorAction Continue + } + Write-Host "IE Enhanced Security Configuration (ESC) has been disabled." } diff --git a/images/win/scripts/Installers/Windows2019/Initialize-VM.ps1 b/images/win/scripts/Installers/Windows2019/Initialize-VM.ps1 index 9930e6a6..46574d7c 100644 --- a/images/win/scripts/Installers/Windows2019/Initialize-VM.ps1 +++ b/images/win/scripts/Installers/Windows2019/Initialize-VM.ps1 @@ -8,7 +8,13 @@ function Disable-InternetExplorerESC { $UserKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}" Set-ItemProperty -Path $AdminKey -Name "IsInstalled" -Value 0 -Force Set-ItemProperty -Path $UserKey -Name "IsInstalled" -Value 0 -Force - Stop-Process -Name Explorer -Force -ErrorAction Continue + + $ieProcess = Get-Process -Name Explorer -ErrorAction SilentlyContinue + + if ($ieProcess){ + Stop-Process -Name Explorer -Force -ErrorAction Continue + } + Write-Host "IE Enhanced Security Configuration (ESC) has been disabled." }