Skip to content

Commit ea6e927

Browse files
committed
Code improved
1 parent d0ccd07 commit ea6e927

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Scripts/IPv4PortScan.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ Process{
181181
# Validate Port-Range
182182
if($StartPort -gt $EndPort)
183183
{
184-
Write-Error -Message "Invalid Port-Range... Check your input!" -Category InvalidArgument -ErrorAction Stop
184+
throw "Invalid Port-Range... Check your input!"
185185
}
186186

187187
# Check if host is reachable
@@ -302,7 +302,7 @@ Process{
302302
$Progress_Percent = 100
303303
}
304304

305-
Write-Progress -Activity "Setting up jobs..." -Id 1 -Status "Current Port: $Port" -PercentComplete ($Progress_Percent)
305+
Write-Progress -Activity "Setting up jobs..." -Id 1 -Status "Current Port: $Port" -PercentComplete ($Progress_Percent)
306306

307307
# Create mew job
308308
$Job = [System.Management.Automation.PowerShell]::Create().AddScript($ScriptBlock).AddParameters($ScriptParams)

0 commit comments

Comments
 (0)