Get-content -path z:\path\name.txt |
foreach {
(get-hotfix -Computername $_ |
Sort-object IUnstalledon)[-1]
}我想数数并将计数放在输出(get-hotfix )的前面。
1 computer-name update ncncncncn cncncncncncn date time
2 computer name.....发布于 2014-01-08 18:08:29
也许是这样的?
#Count variable
$i = 0
Get-content -path z:\path\name.txt |
foreach {
$hotfix = (get-hotfix -Computername $_ | Sort-object IUnstalledon)[-1]
#Create your output string "Count ComputerName Hotfix"
Write-Output "$i $_ $hotfix"
$i++
}https://stackoverflow.com/questions/21002853
复制相似问题