I am trying to use the GCI cmdlet to get information on many remote computers, some of which are sometimes turned off or unresponsive. Is there a way I can specify a timeout property for get-childitem so that the script doesn’t hang for 15-20 seconds every time it hits an unresponsive computer?
Thanks,
Tomek
Or wrap your gci in test-connection
if (test-connection $server -quiet){
gci
}
else {“Connect failed to $server”}