powshell如何使 write-output 输出多列?
powershell吧
全部回复
仅看楼主
level 2
z516645807 楼主
$ComputerName |foreach {
gwmi -class win32_share -ComputerName $_ComputerName |foreach{
if(($_.name -eq "NETLOGON") -or ($_.name -eq "SYSVOL") -or ($_.name -eq "IPC$")){
Write-output $_.PSComputerName $_.name $_.status
}
}
}
以上write-output输出的如下:
AD1
NETLOGN
OK
AD1
SYSVOL
OK
如何使write-output输出为三列:
AD1 NETLOGON OK
AD1 SYSVOL OK
我知道 write-host可以 但是wirte-host只显示到控制台,不能使用管道和赋值给其它变量,求大神帮忙
2021年10月21日 09点10分 1
level 1
formattable | convertto-csv
2021年10月24日 08点10分 2
多谢[哈哈]
2022年01月05日 02点01分
1