I have this code that works:
gc C:\Tools\PingComputers\Input.txt |?{ (gwmi Win32_PingStatus -Filter "Address='$_'").StatusCode -eq 0 } | out-file C:\Tools\PingComputers\Pingable.txt
How would I also create a .txt file of the machines that it CAN'T ping?
Also, I don't understand what the question mark does. How is it used in this code?