Skip to content

Commit 4e7a54f

Browse files
committed
Write-Verbose show wrong number of jobs - fixed
1 parent c39127a commit 4e7a54f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Scripts/New-IPv4Scan.ps1

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ Process{
654654
continue
655655
}
656656

657-
Write-Verbose "Processing $($Jobs_ToProcess.Count) jobs..."
657+
Write-Verbose "Processing $($Jobs_ToProcess.Count + 1) job(s)..."
658658

659659
# Processing completed jobs
660660
foreach($Job in $Jobs_ToProcess)
@@ -665,7 +665,7 @@ Process{
665665

666666
# Remove job from collection
667667
$Jobs.Remove($Job)
668-
668+
669669
# Check if result is null --> if not, return it
670670
if($Job_Result -ne $null)
671671
{
@@ -678,9 +678,10 @@ Process{
678678
$Job_Result
679679
}
680680
}
681-
}
681+
}
682+
682683
} While ($Jobs.Count -gt 0)
683-
684+
684685
Write-Verbose "Closing RunspacePool and free resources..."
685686

686687
# Close the RunspacePool and free resources

0 commit comments

Comments
 (0)