Powershell Tip #6: Create an infinite loop
Tip: You can create an endless loop using while or for :
1 2 3 4 5 6 7 8 9 10 11 12 13 |
# Solution 1 while ($true) { Test-Connection -ComputerName $computer -Quiet } # Solution 2 for ( ; ; ) { Test-Connection -ComputerName $computer -Quiet } |