-
Notifications
You must be signed in to change notification settings - Fork 283
Improved checking Hyper-V status on Windows #4044
Conversation
Updated the relevant Powershell script to use the field HypervisorPresent from Win32_ComputerSystem WMI object. This provides a more reliable way of determining hypervisor availability on the system.
Wiezzel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HypervisorPresent is true even if hypervisor service is not running.
|
Ok, I'll keep the check for |
|
@zakaprov Maybe instead of this try-catch do this: (Get-Service -Name vmms).Status -Eq "Running" |
|
And you could also check |
|
@Wiezzel Good one, thanks. I might still need to wrap the call to |
Wiezzel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If $IsHypervisorPresent is False the script should return False.
|
@Wiezzel It does return |
Codecov Report
@@ Coverage Diff @@
## b0.19 #4044 +/- ##
=======================================
Coverage 89.25% 89.25%
=======================================
Files 205 205
Lines 18431 18431
=======================================
Hits 16450 16450
Misses 1981 1981 |
Resolves: #4024
Updated the relevant Powershell script to use the field
HypervisorPresent from Win32_ComputerSystem WMI object. This provides a
more reliable way of determining hypervisor availability on the system.