Skip to content

Commit a39fd6a

Browse files
authored
Merge pull request #347 from Earlopain/speedup-windows-cpu
Improve speed for `Get-CimInstance`
2 parents ea82067 + b10c2b4 commit a39fd6a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/parallel.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ def worker_number=(worker_num)
357357
def physical_processor_count_windows
358358
# Get-CimInstance introduced in PowerShell 3 or earlier: https://learn.microsoft.com/en-us/previous-versions/powershell/module/cimcmdlets/get-ciminstance?view=powershell-3.0
359359
result = run(
360-
'powershell -command "Get-CimInstance -ClassName Win32_Processor ' \
360+
'powershell -command "Get-CimInstance -ClassName Win32_Processor -Property NumberOfCores ' \
361361
'| Select-Object -Property NumberOfCores"'
362362
)
363363
if !result || $?.exitstatus != 0

0 commit comments

Comments
 (0)