3

I have a Windows Server 2012 R2 instance running on Hyper-V that I'm attempting to update from PowerShell 4.0 to PowerShell 5.1. Once the update has been applied, I reboot the server to apply the updates and immediately afterwards, Windows displays:

We couldn't complete the updates

Undoing Changes

Don't turn off your computer

Researching online has led me to believe that it is an issue with the Secure-Boot option in Hyper-V. When I attempt to edit this option in Powershell:

Set-VMFirmware "Build Server" -EnableSecureBoot Off

I am given the error:

Set-VMFirmware : A parameter is invalid. Generation 1 virtual machines do not support the VMFirmware cmdlets

How can I find the root cause of this issue, and if disabling the Secure-Boot in Hyper-V is the solution, how can I do this on a Gen1 VM?

EDIT: After attempting to update Windows with the latest patches, I received the same "couldn't complete the updates Undoing changes" message. This seems to be a problem with the windows update, and not PowerShell specifically...

2
  • 1
    Gen1 VMs don’t use secure boot. So that probably isn’t your problem. Is .NET the correct version? WMF/Powershell requires a certain version of .NET that the system might not have if you haven’t already applied all updates.
    – Zoredache
    Dec 5, 2017 at 16:43
  • I am running .NET 4.6.1. It looks like Powershell 5.0 requires .NET 4.5, so I don't think that's the problem... Dec 5, 2017 at 16:53

1 Answer 1

1

After a few hours of researching, it appears that the issue was not due to the Secure-Boot on the VM, but was instead because of the contents/volume of the Windows Temp directory. This appears to be an issue in Azure Windows VMs as well. The C:\Windows\Temp directory on my VM was ~2.8gb. The steps I followed were:

  1. Remove any handles on C:\Windows\Temp
  2. Delete C:\Windows\Temp
  3. Run Windows Update
  4. Restart Virtual Machine
  5. Run the Windows Server 2012 R2 Windows Mangement Framework 5.1 installer
  6. Restart Virtual Machine

Note: Some sources suggested setting the TEMP environment variable to point to C:\Windows\Temp directly if it already does not. My TEMP variable points to the administrator account's temp directory. I did not change this when following the steps above. In this case, it did not appear to make a difference.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .