Hi,
If you execute the following command on a remote computer and that remote computer looses network connection, the command tries to reconnect for a long time.
Invoke-Command -ComputerName computer01 -ScriptBlock {Start-Sleep -Seconds 3600}
Errors you get are: "WARNING: The network connection to sbc-2019-pvs11 has been interrupted. Attempting to reconnect for up to 4 minutes..."
How do you prevent the reconnecting? I just want it to stop after a few seconds when a network issue occurs.
Thanks,
Chris