Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Using PortQry to test Firewall Rules
# Grab some user input
$Server = Read-Host "Enter the Server's name or IP"
$Port = Read-Host "Enter the Port Number"
# Be careful of this path~!
$K = C:\PortQryV2\PortQry.exe -n $Server -e $Port -p TCP
$L = $K -Match "LIS?"
If($L -ne $null)
{
$res = $Port + " on " + $Server + " is " + "Open"
Write-Host $res
}
Else
{
$res = $Port + " on " + $Server + " is " + "Closed"
Write-Host $res
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.