在高级ssh和powershell中使用racadm

在高级ssh和powershell中使用racadm,powershell,posh-ssh,Powershell,Posh Ssh,我正在运行一个racadm命令来查找Posh Ssh模块上的核心数量,有人知道如何计算总数吗 $get_CoreInfo = Invoke-SSHCommand -Index 0 -command "racadm get BIOS.ProcSettings" Core_Number = ($get_CoreInfo.Output -match '(.*)NumCores=' -replace '(.*)NumCores=' ) 给你这个输出:8但是我想要完整的金额 还知道如何获得CPU计数吗

我正在运行一个racadm命令来查找Posh Ssh模块上的核心数量,有人知道如何计算总数吗

$get_CoreInfo = Invoke-SSHCommand -Index 0 -command "racadm get BIOS.ProcSettings" 
Core_Number = ($get_CoreInfo.Output -match '(.*)NumCores=' -replace '(.*)NumCores=' )
给你这个输出:
8
但是我想要完整的金额

还知道如何获得CPU计数吗?在文档中似乎看不到任何内容


谢谢

如果最终输出中的数字被空格分割,请尝试以下操作:

$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}