Created
October 17, 2018 16:42
-
-
Save bohops/2f9d745bbc3e83d6c5b25b22834c13a2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while ($true) { | |
$(Get-Date).ToUniversalTime() | |
$Runspace = [runspacefactory]::CreateRunspace() | |
$PowerShell = [powershell]::Create() | |
$PowerShell.runspace = $Runspace | |
$Runspace.Open() | |
[void]$PowerShell.AddScript({ | |
$tcpConnection = New-Object System.Net.Sockets.TcpClient('1.1.1.1', 80) | |
$tcpStream = $tcpConnection.GetStream() | |
$tcpConnection.close() | |
}) | |
$PowerShell.Invoke() | |
start-sleep -s 10 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment