2
我試圖獲取沒有防病毒但出文件與計算機名稱單行的計算機的列表,任何人都可以幫忙嗎?向Out-File cmdlet添加換行符
ForEach ($COMPUTER in (Get-ADComputer -Filter {OperatingSystem -notLike '*windows xp*' } | Select-Object -ExpandProperty Name))
{if(!(Test-Connection -Cn $computer -BufferSize 16 -Count 1 -ea 0 -quiet))
{write-host "cannot reach $computer" -f red}
else {
try
{
$AntiVirusProduct = Get-WmiObject -Namespace "root\SecurityCenter2" -Class AntiVirusProduct -ComputerName $computer -ErrorAction Stop
}
catch
{
Write-Warning "[ERROR] invalid namespace [$($computer)] : $_"
$noantivirus+=$computer
}
$noantivirus | out-file -Encoding Ascii -append c:\noantivirus.txt}}
不算其製作的三角形le,矩形 – DisplayName