diff --git a/Data/gamblecore.wav b/Data/gamblecore.wav new file mode 100644 index 0000000..9ca957d Binary files /dev/null and b/Data/gamblecore.wav differ diff --git a/Data/xfiles.wav b/Data/xfiles.wav new file mode 100644 index 0000000..76b80cc Binary files /dev/null and b/Data/xfiles.wav differ diff --git a/Private/Find-ISMBusinessObject.ps1 b/Private/Find-ISMBusinessObject.ps1 index fc51b8d..ec24733 100644 --- a/Private/Find-ISMBusinessObject.ps1 +++ b/Private/Find-ISMBusinessObject.ps1 @@ -134,7 +134,7 @@ Function Find-ISMBusinessObject { if (!$Query){ - Write-Host "No results returned for the $BusinessObject Business Object!" -ForegroundColor yellow + #Write-Host "No results returned for the $BusinessObject Business Object!" -ForegroundColor yellow } elseif ($Query.Edmx){ @@ -238,7 +238,7 @@ Function Find-ISMBusinessObject { } catch { - write-warning "Failed querying for $BusinessObject!" + write-warning "Failed querying Spark!" } diff --git a/Private/Get-Hostname.ps1 b/Private/Get-Hostname.ps1 index b6b8ccd..090cdf6 100644 --- a/Private/Get-Hostname.ps1 +++ b/Private/Get-Hostname.ps1 @@ -36,14 +36,14 @@ function Get-Hostname ([string]$name) { $sccmMatches = Get-SCCM_HostnameMatch $name if ($SCCMMatches -and $SCCMMatches.Count -lt 2) { return $SCCMMatches,'' - } elseif (!$SCCMMatches) { $errMsg += "No SCCM match found`n" } + } elseif (!$SCCMMatches) { $errMsg += "No SCCM name match found`n" } elseif ($SCCMMatches.Count -ge 2) { $errMsg += "Many SCCM matches found`n" } # CMDB check should be absolute last resort $cmdbMatches = Find-ISMBO -bo cis -SearchQuery $name if ($cmdbMatches -and $cmdbMatches.Count -lt 2) { return $cmdbMatches.Name,'' - } elseif (!$cmdbMatches) { $errMsg += "No CMDB match found`n" } + } elseif (!$cmdbMatches) { $errMsg += "No CMDB name match found`n" } elseif ($cmdbMatches.Count -ge 2) { # Try more specific queries # Asset tag diff --git a/Private/Get-ISMBusinessObject.ps1 b/Private/Get-ISMBusinessObject.ps1 index ac60eae..275afd7 100644 --- a/Private/Get-ISMBusinessObject.ps1 +++ b/Private/Get-ISMBusinessObject.ps1 @@ -164,7 +164,7 @@ Function Get-ISMBusinessObject { if (!$Query){ - Write-Host "No results returned for the $BusinessObject Business Object!" -ForegroundColor yellow + #Write-Host "No results returned for the $BusinessObject Business Object!" -ForegroundColor yellow } elseif ($Query.Edmx){ @@ -268,7 +268,7 @@ Function Get-ISMBusinessObject { } catch { - write-warning "Failed querying for $BusinessObject!" + write-warning "Failed querying Spark!" } diff --git a/Private/Search-ISMBusinessObject.ps1 b/Private/Search-ISMBusinessObject.ps1 index 33eb68a..3d6a41c 100644 --- a/Private/Search-ISMBusinessObject.ps1 +++ b/Private/Search-ISMBusinessObject.ps1 @@ -138,7 +138,7 @@ BEGIN { ### If we have no BOMetaDataProperties then an invalid BusinessObject was supplied. if (!$BOMetaDataProperties){ $ValidSyntax = $false - Write-Host "Unable to query Metadata for the $BusinessObject Business Object! Check the name and try again." -ForegroundColor yellow + Write-Host "Failed querying Spark!" -ForegroundColor yellow } elseif ($BOMetaDataProperties.EntityType.count){ $BOMetaDataProperties = $BOMetaDataProperties.EntityType[-1].Property.Name | Sort-Object } else { diff --git a/Public/Get-PC.ps1 b/Public/Get-PC.ps1 index 8f3d7eb..7b3d565 100644 --- a/Public/Get-PC.ps1 +++ b/Public/Get-PC.ps1 @@ -244,6 +244,11 @@ Function Get-PC { $comp,$msg = Get-Hostname $comp if ($msg -and -not $SHSPrinter) { + if ($SoundEnabled) { + $oopsSoundPath = Join-Path (get-item $PSScriptRoot).Parent.FullName 'Data\gamblecore.wav' + (New-Object Media.SoundPlayer $oopsSoundPath).Play() + } + Write-Host "`n$msg" -ForegroundColor Red $props = [Ordered]@{ @@ -599,6 +604,10 @@ Function Get-PC { if ($adTest) { Write-Warning "$comp is either disabled or off the domain" + if ($SoundEnabled) { + $oopsSoundPath = Join-Path (get-item $PSScriptRoot).Parent.FullName 'Data\xfiles.wav' + (New-Object Media.SoundPlayer $oopsSoundPath).Play() + } } Write-Progress -Activity "Looking up computer in AD" -Completed } diff --git a/patchnotes.txt b/patchnotes.txt index ec52200..34b3b47 100644 --- a/patchnotes.txt +++ b/patchnotes.txt @@ -4,6 +4,8 @@ Patch: 2024-09-13 -Refactor BatchInvokes uses Get-PCLocal so there is only one spot to update -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 +-Tip try setting $SoundEnabled = $true Patch: 2024-09-12 -Fix Hostnames now check SCCM for a hostname match as a fallback