Files
runner-images-sangeeth/images/win/post-generation/Remove-AzureRegistrySettings.ps1
Dibir Magomedsaygitov 94c7463a7f rename folder
2020-09-29 18:16:37 +03:00

10 lines
898 B
PowerShell

# Script to address any current issues with images that could be easily worked around.
$ErrorActionPreference="Stop"
# Remove 3 registry settings that are left behind when sysprepping. Having those registry settings together with a
# race condition that kicks in when trying to run custom scripts extensions and stops us from reimaging machines.
# ICM: https://portal.microsofticm.com/imp/v3/incidents/details/191973270/home
Remove-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Azure\HandlerState' -Name 'Incarnation' -Force -ErrorAction Ignore
Remove-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Azure\HandlerState' -Name 'InVmSvdSeqNo' -Force -ErrorAction Ignore
Remove-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Azure\HandlerState' -Name 'LastGoalStateMethod' -Force -ErrorAction Ignore