diff --git a/Private/Get-Hostname.ps1 b/Private/Get-Hostname.ps1 index 090cdf6..1be9dae 100644 --- a/Private/Get-Hostname.ps1 +++ b/Private/Get-Hostname.ps1 @@ -37,7 +37,7 @@ function Get-Hostname ([string]$name) { if ($SCCMMatches -and $SCCMMatches.Count -lt 2) { return $SCCMMatches,'' } elseif (!$SCCMMatches) { $errMsg += "No SCCM name match found`n" } - elseif ($SCCMMatches.Count -ge 2) { $errMsg += "Many SCCM matches found`n" } + elseif ($SCCMMatches.Count -ge 2) { $errMsg += "Many SCCM name matches found`n" } # CMDB check should be absolute last resort $cmdbMatches = Find-ISMBO -bo cis -SearchQuery $name diff --git a/Private/PCLocal.ps1 b/Private/PCLocal.ps1 index 14b34ab..05ff13e 100644 --- a/Private/PCLocal.ps1 +++ b/Private/PCLocal.ps1 @@ -46,7 +46,10 @@ $MAC = ($win32_networkadapterconfiguration | Where-Object {$_.IpEnabled -Match "True"} | Select-Object -Expand macaddress) -join "," #IP - $ip = ($win32_networkadapterconfiguration | Where-Object {$_.IpEnabled -Match "True"} | Select-Object -Expand IPAddress) -join "," + $ip = ($win32_networkadapterconfiguration | Where-Object {$_.IpEnabled -Match "True"} | Select-Object -Expand IPAddress | + # IPv4 address filter + Where-Object {$_ -match "^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$"} + ) -join "," <# if($ip -is [array]){ $ip = $ip[0] diff --git a/patchnotes.txt b/patchnotes.txt index 34b3b47..f862cba 100644 --- a/patchnotes.txt +++ b/patchnotes.txt @@ -1,3 +1,5 @@ +-Fix when reporting many IP addresses, now only displays ipv4 + Patch: 2024-09-13 -Fix Order of hostame resolution changed so it's more consistent with true hostname -Remove MBAM GPO from output @@ -5,6 +7,7 @@ Patch: 2024-09-13 -Fix shortened Spark! timeout since Spark! typically won't succeed after 5 seconds -Fix bug when querying mobile devices -Fix Less helpful (and less confusing) ISM error messages +-Fix all ip addresses reported when more than one are present -Tip try setting $SoundEnabled = $true Patch: 2024-09-12