此语句的结果是:
PS C:\> Get-Process Cougar | Select-Object -Property Id Id -- 2939 85944
我将其加载到数组和字符串中,以跳过“ Id”并仅打印出数字。
$cougarpid = @(Get-Process Cougar | Select-Object -Property Id)
foreach ($coug in $cougarpid) {
if ($coug -like "Id") {
continue
}
$coug
}
我只想要
2939 85944