$computers = gc "C:\temp\server.
txt"
$destination= "c$\windows"
$File= New-Item C:\temp\foldercheck_result.txt -type file -Force
foreach ($computer in $computers)
{
if ( Test-Connection -ComputerName $computer -Count 1 -ErrorAction
SilentlyContinue )
{
if ((Test-Path -Path \\$computer\$destination))
{
write-output "$computer windows YES" | out-file $file -append
else { write-output "$computer windows NO" | out-file $file -append
}
}
else { Write-host "$computer is not on Network" }
}