mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-09 05:04:39 +02:00
Updated the Markdown manuals
This commit is contained in:
35
docs/scan-network.md
Normal file
35
docs/scan-network.md
Normal file
@ -0,0 +1,35 @@
|
||||
Script: *scan-network.ps1*
|
||||
========================
|
||||
|
||||
scan-network.ps1
|
||||
|
||||
|
||||
Parameters
|
||||
----------
|
||||
```powershell
|
||||
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
Script Content
|
||||
--------------
|
||||
```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
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of scan-network.ps1 as of 05/19/2024 10:25:25)*
|
Reference in New Issue
Block a user