Hello,
I’m starting a Github action to build a image with packer. But when the sysprep starts it seems not to end anymore.
Any advise would be great.
Last part of my code :
provisioner “powershell” {
inline = \[
"while ((Get-Service RdAgent).Status -ne 'Running') { Start-Sleep -s 5 }",
"while ((Get-Service WindowsAzureGuestAgent).Status -ne 'Running') { Start-Sleep -s 5 }",
"& $env:SystemRoot\\\\System32\\\\Sysprep\\\\Sysprep.exe /unattend:A:\\\\Autounattend.xml /quiet /generalize /oobe /shutdown",
"while ($true) { $imageState = Get-ItemProperty HKLM:\\\\SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Setup\\\\State | Select ImageState; if($imageState.ImageState -ne 'IMAGE_STATE_GENERALIZE_RESEAL_TO_OOBE') { Write-Output $imageState.ImageState; Start-Sleep -s 10 } else { break } }"
\]
}