Skip to content

Commit 8b6a94a

Browse files
authored
Add validate for ports
1 parent 42a8284 commit 8b6a94a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Scripts/New-IPv4PortScan.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@ param(
3939
[Parameter(
4040
Position=1,
4141
HelpMessage='First port which should be scanned (Default=1)')]
42+
[ValidateRange(1,65535)]
4243
[Int32]$StartPort=1,
4344

4445
[Parameter(
4546
Position=2,
4647
HelpMessage='Last port which should be scanned (Default=65535)')]
48+
[ValidateRange(1,65535)]
4749
[Int32]$EndPort=65535,
4850

4951
[Parameter(
@@ -387,4 +389,4 @@ Process{
387389

388390
End{
389391

390-
}
392+
}

0 commit comments

Comments
 (0)