0

I'm running a racadm command to find the number of Core count on the Posh-Ssh module, would anyone know how to count the total amount?

$get_CoreInfo = Invoke-SSHCommand -Index 0 -command "racadm get BIOS.ProcSettings" 
Core_Number = ($get_CoreInfo.Output -match '(.*)NumCores=' -replace '(.*)NumCores=' )

gives you this output: 8 8 but I would like the complete amount.

Also any idea how to get the CPU Count? Can't seem to see anything in the documentation.

Thanks!

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
NW_92
  • 119
  • 1
  • 1
  • 5

1 Answers1

1

If the numbers in your final output are split by a white space, then try this:

$get_CoreInfo = Invoke-SSHCommand -Index 0 -command "racadm get BIOS.ProcSettings" 
$core_number_string = ($get_CoreInfo.Output -match '(.*)NumCores=' -replace '(.*)NumCores=')
$core_number = 0
foreach($cpu in ($core_number_string -split " ")){[int]$core_number += [int]$cpu}
azarij
  • 71
  • 1