PSWindowsUpdate
PSWindowsUpdate copied to clipboard
Object reference not set to an instance of an object.
I'm getting this error when trying to perform a Windows update using Packer to build a win11-23h2-ent VM in Azure:
2024-07-09T18:24:25-07:00: ==> azure-arm.autogenerated_1: Install-WindowsUpdate : Something goes wrong: Update for Windows Security platform antimalware platform - KB5007651
2024-07-09T18:24:25-07:00: ==> azure-arm.autogenerated_1: (Version 1.0.2402.27001); Object reference not set to an instance of an object.
2024-07-09T18:24:25-07:00: ==> azure-arm.autogenerated_1: At C:\Windows\Temp\script-668de296-dc4e-939c-b1ea-098a3fa74e58.ps1:18 char:1
2024-07-09T18:24:25-07:00: ==> azure-arm.autogenerated_1: + Install-WindowsUpdate -AcceptAll -AutoReboot
2024-07-09T18:24:25-07:00: ==> azure-arm.autogenerated_1: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2024-07-09T18:24:25-07:00: ==> azure-arm.autogenerated_1: + CategoryInfo : CloseError: (:) [Get-WindowsUpdate], Exception
2024-07-09T18:24:25-07:00: ==> azure-arm.autogenerated_1: + FullyQualifiedErrorId : Debug,PSWindowsUpdate.GetWindowsUpdate
2024-07-09T18:24:25-07:00: ==> azure-arm.autogenerated_1:
2024-07-09T18:24:25-07:00: ==> azure-arm.autogenerated_1: Script exited with non-zero exit status: 1. Allowed exit codes are: [0]
2024-07-09T18:24:25-07:00: ==> azure-arm.autogenerated_1: Step "StepProvision" failed
This is a similar error to the packer-plugin-windows-update described in this issue that I recently opened, so maybe they are somewhat related - something that was never expected to be null is now null maybe?
https://github.com/rgl/packer-plugin-windows-update/issues/144
I'm suddenly seeing this same error on a wide range of machines.
This issue is most likely caused by KB5040442, similar to the one I posted in the packer-plugin-windows-update issue. A workaround is to use a previous Windows version that does not include that update and/or exclude installing KB5040442 for now until there's a fix for it from Microsoft.
I'm suddenly seeing this same error on a wide range of machines.
same issue for me...
It's on multiple machines with multiple updates. It's not just one problematic update from Microsoft.
Have a look here, I suppose, it's related...
https://learn.microsoft.com/en-us/windows/release-health/status-windows-11-23H2#the-june-2024-preview-update-might-impact-applications-using-windows-update-apis
It happens with all users I tried. system account, Administrator accounts ,normal account. Same error message as above.
Updating PSWindowsUpdate to version 2.2.1.5 resolved the issue for me.
Updating PSWindowsUpdate to version 2.2.1.5 resolved the issue for me.
Thanks a lot! I will try also and I will give here feedback!
Updating PSWindowsUpdate to version 2.2.1.5 resolved the issue for me.
Seems to working, yes! Thanks a lot again ;-)
Thanks, that also worked for me! :)