Skip to content

Instantly share code, notes, and snippets.

@wuping2004
Created June 4, 2020 07:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wuping2004/ae43110e44f3b9b6a3cab7da92964f75 to your computer and use it in GitHub Desktop.
Save wuping2004/ae43110e44f3b9b6a3cab7da92964f75 to your computer and use it in GitHub Desktop.
$ip = "127.0.0.1"
$a = @(1025..1027)
$b = @(19000..19010)
$c = 445,139
$port = $a + $b + $c
$(Foreach($item in $port)
{
$res = Test-NetConnection -ComputerName $ip -Port $item -InformationLevel Quiet
Write-host "Scanning" $ip : $item $res
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment