PowerShell script to fix Hyper-V Virtual Machines sticking at 6% starting issue

Looking at Hyper-V management console showed that the virtual machine was sitting at “Starting (6%)” under the status column. A bit of investigation revealed that this was the result of a known issue “a problem with Hyper-V finding a valid certificate”. To give a bit more context: When you start a VM, we start a […]

Looking at Hyper-V management console showed that the virtual machine was sitting at “Starting (6%)” under the status column. A bit of investigation revealed that this was the result of a known issue “a problem with Hyper-V finding a valid certificate”. To give a bit more context: When you start a VM, we start a Remote Desktop listener that’ll allow you to connect to VM and view display of the VM. In order to do this in a secure fashion – we check certificate store on your computer to find the best available certificate to secure Remote Desktop connection with. The problem happens when you've certificates in your certificate store that we’re unable to validate,” explains Ben. Stefan Wernli posted a PowerShell script that identify a valid certificate and configure Hyper-V to always use that certificate – instead of searching for best certificate each time you start a VM.

Download: script

[Source]