Skip to content

Commit ebae4de

Browse files
author
JustinGrote
committed
Bugfix: Argumentlist presented as a single string doesn't get processed
1 parent dde3f0a commit ebae4de

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

PoshNmap/Public/Invoke-Nmap.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ function Invoke-Nmap {
2828
$computerName = "localhost",
2929

3030
#Specify raw argument parameters to nmap
31-
[String[]]
3231
[Parameter(
3332
ParameterSetName="custom",
3433
Mandatory,
3534
Position=1
3635
)]
36+
[String[]]
3737
$ArgumentList,
3838

3939
[String]
@@ -58,6 +58,7 @@ function Invoke-Nmap {
5858
[Parameter()]
5959
$snmpCommunityList = @("private","public")
6060
)
61+
if ($ArgumentList) {$ArgumentList = $ArgumentList.split(' ')}
6162

6263
if ($Preset -and ($PSCmdlet.ParameterSetName -ne 'Custom')) {
6364
$nmapPresetArgumentNames = (Get-NmapPresetArguments).keys
@@ -74,7 +75,7 @@ function Invoke-Nmap {
7475
$argumentList += '--script','snmp-brute','--script-args',"snmpbrute.communitiesdb=$snmpCommunityFile"
7576
}
7677

77-
if ($All) {
78+
if (-not $All) {
7879
$argumentList += '--open'
7980
}
8081

0 commit comments

Comments
 (0)