aww dangit

This commit is contained in:
Zachary Gorman 2024-09-13 16:55:52 -07:00
parent ddd1f02fed
commit c0a406a590
8 changed files with 18 additions and 7 deletions

BIN
Data/gamblecore.wav Normal file

Binary file not shown.

BIN
Data/xfiles.wav Normal file

Binary file not shown.

View file

@ -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!"
}

View file

@ -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

View file

@ -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!"
}

View file

@ -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 {

View file

@ -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
}

View file

@ -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