Advertisement
Cogger

Wait-Until-NextMinute.ps1

Jun 23rd, 2022 (edited)
432
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $txtfile = "C:\temp\test\" + "$env:COMPUTERNAME" + ".log"
  2.  
  3. if((Test-Path -Path $txtfile -PathType Leaf) -eq $true){ Remove-Item  -Path $txtfile -ErrorAction SilentlyContinue ; sleep 1 }
  4.  
  5. $newDate = (get-date).AddMinutes(1).ToString("HH:mm")
  6. (New-TimeSpan -End "$newDate").TotalSeconds | Sleep;
  7.  
  8.  
  9.  
  10. $netTest  = ping 8.8.8.8
  11. $netTest2 = ipconfig /all
  12. $netTest3 = Test-NetConnection
  13.  
  14. Add-Content $txtFile $netTest
  15. Add-Content $txtFile $netTest2
  16. Add-Content $txtFile $netTest3
  17.  
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement