Skip to content

Commit e99fd8a

Browse files
committed
Fixed a bug with switch parameter
1 parent 9f0f1f9 commit e99fd8a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Scripts/New-IPv4NetworkScan.ps1

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -429,11 +429,11 @@ Begin{
429429

430430
Process{
431431
# Check for vendor list update
432-
if($UpdateList.IsPresent)
432+
if($UpdateList)
433433
{
434434
UpdateListFromIEEE
435435
}
436-
elseif(($EnableMACResolving.IsPresent) -and (-Not([System.IO.File]::Exists($CSV_MACVendorList_Path))))
436+
elseif(($EnableMACResolving) -and (-Not([System.IO.File]::Exists($CSV_MACVendorList_Path))))
437437
{
438438
Write-Host 'No CSV-File to assign vendor with MAC-Address found! Use the parameter "-UpdateList" to download the latest version from IEEE.org. This warning doesn`t affect the scanning procedure.' -ForegroundColor Yellow
439439
}
@@ -477,18 +477,18 @@ Process{
477477
$PropertiesToDisplay = @()
478478
$PropertiesToDisplay += "IPv4Address", "Status"
479479

480-
if($DisableDNSResolving.IsPresent -eq $false)
480+
if($DisableDNSResolving -eq $false)
481481
{
482482
$PropertiesToDisplay += "Hostname"
483483
}
484484

485-
if($EnableMACResolving.IsPresent)
485+
if($EnableMACResolving)
486486
{
487487
$PropertiesToDisplay += "MAC"
488488
}
489489

490490
# Check if it is possible to assign vendor to MAC --> import CSV-File
491-
if(($EnableMACResolving.IsPresent) -and ([System.IO.File]::Exists($CSV_MACVendorList_Path)))
491+
if(($EnableMACResolving) -and ([System.IO.File]::Exists($CSV_MACVendorList_Path)))
492492
{
493493
$AssignVendorToMAC = $true
494494

@@ -501,7 +501,7 @@ Process{
501501
$AssignVendorToMAC = $false
502502
}
503503

504-
if($ExtendedInformations.IsPresent)
504+
if($ExtendedInformations)
505505
{
506506
$PropertiesToDisplay += "BufferSize", "ResponseTime", "TTL"
507507
}
@@ -550,7 +550,7 @@ Process{
550550
# +++ Resolve DNS +++
551551
$Hostname = [String]::Empty
552552

553-
if((-not($DisableDNSResolving.IsPresent)) -and ($Status -eq "Up" -or $IncludeInactive.IsPresent))
553+
if((-not($DisableDNSResolving)) -and ($Status -eq "Up" -or $IncludeInactive))
554554
{
555555
try{
556556
$Hostname = ([System.Net.Dns]::GetHostEntry($IPv4Address).HostName)
@@ -561,7 +561,7 @@ Process{
561561
# +++ Get MAC-Address +++
562562
$MAC = [String]::Empty
563563

564-
if(($EnableMACResolving.IsPresent) -and ($Status -eq "Up"))
564+
if(($EnableMACResolving) -and ($Status -eq "Up"))
565565
{
566566
$Arp_Result = (arp -a ).ToUpper()
567567

@@ -590,7 +590,7 @@ Process{
590590
$ResponseTime = [String]::Empty
591591
$TTL = $null
592592

593-
if($ExtendedInformations.IsPresent -and ($Status -eq "Up"))
593+
if($ExtendedInformations -and ($Status -eq "Up"))
594594
{
595595
try{
596596
$BufferSize = $PingResult.Buffer.Length
@@ -601,7 +601,7 @@ Process{
601601
}
602602

603603
# +++ Result +++
604-
if($Status -eq "Up" -or $IncludeInactive.IsPresent)
604+
if($Status -eq "Up" -or $IncludeInactive)
605605
{
606606
$Result = [pscustomobject] @{
607607
IPv4Address = $IPv4Address

0 commit comments

Comments
 (0)