Skip to content

Commit

Permalink
Merge pull request #347 from Earlopain/speedup-windows-cpu
Browse files Browse the repository at this point in the history
Improve speed for `Get-CimInstance`
  • Loading branch information
grosser authored Jun 8, 2024
2 parents ea82067 + b10c2b4 commit a39fd6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/parallel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ def worker_number=(worker_num)
def physical_processor_count_windows
# 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
result = run(
'powershell -command "Get-CimInstance -ClassName Win32_Processor ' \
'powershell -command "Get-CimInstance -ClassName Win32_Processor -Property NumberOfCores ' \
'| Select-Object -Property NumberOfCores"'
)
if !result || $?.exitstatus != 0
Expand Down

0 comments on commit a39fd6a

Please sign in to comment.