Skip to content

Commit

Permalink
fix: do not wait for sysprep full completion on Azure VM to avoid edg…
Browse files Browse the repository at this point in the history
…e cases

Signed-off-by: Damien Duportal <[email protected]>
  • Loading branch information
dduportal committed Sep 17, 2021
1 parent 1f3d4b1 commit caa31e3
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions scripts/windows-2019-provision.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -190,18 +190,8 @@ switch($env:CLOUD_TYPE) {
C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\SendWindowsIsReady.ps1 -Schedule
}
'azure-arm' {
# Azure needs the image sysprep'd manually, AWS is done using AWS scripts from the json
& $env:SystemRoot\System32\Sysprep\Sysprep.exe /oobe /generalize /quiet /quit
while($true) {
$imageState = Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State' | Select-Object ImageState
if($imageState.ImageState -ne 'IMAGE_STATE_GENERALIZE_RESEAL_TO_OOBE') {
Write-Output $imageState.ImageState
Start-Sleep -s 5
} else {
break
}
}
Break
# Azure needs the image sysprep'd manually
& $env:SystemRoot\System32\Sysprep\Sysprep.exe /oobe /generalize /quiet /shutdown
}
}

Expand Down

0 comments on commit caa31e3

Please sign in to comment.