Enable powershell file execution.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Enter command line arguments with comma(,
)
- first argument : ip addresses
- second argument : ports
- third argument(optional) : timeout value(default value is 300ms)
PS C:\Users> .\WindowFirewallTest.ps1 "127.0.0.1,192.168.137.1" "32000,139" 500
=====FIREWALL CHECK START=====
========Timeout : 500ms=======
127.0.0.1 32000 is opened
127.0.0.1 139 is closed
192.168.137.1 32000 is closed
192.168.137.1 139 is opened
=====FIREWALL CHECK END======