Skip to content

Commit

Permalink
Fix for cpuCores on HyperV2012R2 by @berkut1 #219
Browse files Browse the repository at this point in the history
  • Loading branch information
FuseCP-TRobinson committed Dec 30, 2024
1 parent 9bb1b43 commit 28ff929
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2146,7 +2146,9 @@ public ChangeJobStateReturnCode ChangeJobState(string jobId, ConcreteJobRequeste
public int GetProcessorCoresNumber()
{
int coreCount = 0;
foreach (var item in new System.Management.ManagementObjectSearcher("Select * from Win32_Processor").Get())
Wmi cimv2 = new Wmi(ServerNameSettings, Constants.WMI_CIMV2_NAMESPACE);

foreach (var item in cimv2.ExecuteWmiQuery("Select * from Win32_Processor"))
{
coreCount += int.Parse(item["NumberOfLogicalProcessors"].ToString());
}
Expand Down

0 comments on commit 28ff929

Please sign in to comment.