Skip to content

Commit f63b9a3

Browse files
committed
Code improved
1 parent c75bf20 commit f63b9a3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Scripts/IPv4NetworkScan.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,12 @@ Begin{
229229

230230
# Split into groups of 8 bits, convert to Ints, join up into a string
231231
$Octets = $CIDR_Bits -split '(.{8})' -ne ''
232-
$Mask = ($Octets | ForEach-Object { [Convert]::ToInt32($_, 2) }) -join '.'
232+
$Mask = ($Octets | ForEach-Object -Process {[Convert]::ToInt32($_, 2) }) -join '.'
233233
}
234234

235235
"Mask" {
236236
# Convert the numbers into 8 bit blocks, join them all together, count the 1
237-
$Octets = $Mask.ToString().Split(".") | ForEach-Object {[Convert]::ToString($_, 2)}
237+
$Octets = $Mask.ToString().Split(".") | ForEach-Object -Process {[Convert]::ToString($_, 2)}
238238
$CIDR_Bits = ($Octets -join "").TrimEnd("0")
239239

240240
# Count the "1" (111111111111111111111111 --> /24)

0 commit comments

Comments
 (0)