mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-12-29 01:58:58 +01:00
14 lines
494 B
PowerShell
14 lines
494 B
PowerShell
|
$a = Get-NetIPAddress | Where-Object -FilterScript { $_.SuffixOrigin -eq "DHCP" -or $_.SuffixOrigin -eq "manual" } # | Format-Table -property IPAddress -autoSize
|
||
|
|
||
|
$arguments = "-sT -T3" # Set sane defaults for command string
|
||
|
$location = "nmap" # In case nmap is not in PATH
|
||
|
$targets = ""
|
||
|
|
||
|
foreach ( $i in $a ) {
|
||
|
$s = $i.IPAddress + "/" + $i.PrefixLength
|
||
|
$targets = $targets + " " + $s
|
||
|
}
|
||
|
$arguments = $arguments + " " + $targets
|
||
|
|
||
|
Start-Process $location -ArgumentList $arguments -Wait
|