Couldn't find an answer, so I thought I ask for myself.
Using C#, how can I check if the CPU has hardware virtualization enabled? Hyper-V, for example. It's not in the Win32_Processor
class, and my attempt to connect to the MSVM_ComputerSystem
was met with utter failure. Keeps telling me there's an invalid namespace.
Code below.
ManagementObjectSearcher vm = new ManagementObjectSearcher(@"\\.\root\virtualization", "select * from MSVM_Computersystem");
ManagementObjectCollection vmCollection = vm.Get();
foreach (ManagementObject mo in vmCollection)
{
cpuVirtual = mo["EnabledState"].ToString();
}