From b295f4bef488baa49716c32ffd0fec44e6465ad5 Mon Sep 17 00:00:00 2001 From: Zachary Gorman Date: Fri, 2 May 2025 08:57:40 -0700 Subject: [PATCH] More robust custom app detection --- Get-PC/Data/SHSApps.json | 30 +++++++++++++++++++++++++++--- Get-PC/Private/Apps.ps1 | 2 +- Get-PC/patchnotes.txt | 3 +++ 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/Get-PC/Data/SHSApps.json b/Get-PC/Data/SHSApps.json index 133abce..7f05251 100644 --- a/Get-PC/Data/SHSApps.json +++ b/Get-PC/Data/SHSApps.json @@ -1,10 +1,34 @@ [ { - "DisplayName": "OBIX", - "Path": "C:\\Program Files\\CCSI" + "DisplayName": "OBIX BS-DUAL-NPI", + "Test": "$(Get-Content \"C:\\Program Files\\CCSI\\800\\8001\\OBIXConfig\\defaults.ini\") -match \"_BS-DUAL-NPI(,|$)\"" + }, + { + "DisplayName": "OBIX BS-SINGLE-NPI", + "Test": "$(Get-Content \"C:\\Program Files\\CCSI\\800\\8001\\OBIXConfig\\defaults.ini\") -match \"_BS-SINGLE-NPI(,|$)\"" + }, + { + "DisplayName": "OBIX CENTRAL", + "Test": "$(Get-Content \"C:\\Program Files\\CCSI\\800\\8001\\OBIXConfig\\defaults.ini\") -match \"_CENTRAL(,|$)\"" + }, + { + "DisplayName": "OBIX CENTRAL-SINGLE", + "Test": "$(Get-Content \"C:\\Program Files\\CCSI\\800\\8001\\OBIXConfig\\defaults.ini\") -match \"_CENTRAL-SINGLE(,|$)\"" + }, + { + "DisplayName": "OBIX CITRIX", + "Test": "$(Get-Content \"C:\\Program Files\\CCSI\\800\\8001\\OBIXConfig\\defaults.ini\") -match \"_CITRIX(,|$)\"" + }, + { + "DisplayName": "OBIX NS-DUAL", + "Test": "$(Get-Content \"C:\\Program Files\\CCSI\\800\\8001\\OBIXConfig\\defaults.ini\") -match \"_NS-DUAL(,|$)\"" + }, + { + "DisplayName": "OBIX NS-SINGLE", + "Test": "$(Get-Content \"C:\\Program Files\\CCSI\\800\\8001\\OBIXConfig\\defaults.ini\") -match \"_NS-SINGLE(,|$)\"" }, { "DisplayName": "GSL Will Call", - "Path": "C:\\Users\\Public\\Desktop\\GSL Will Call Client.url" + "Test": "Test-Path \"C:\\Users\\Public\\Desktop\\GSL Will Call Client.url\"" } ] \ No newline at end of file diff --git a/Get-PC/Private/Apps.ps1 b/Get-PC/Private/Apps.ps1 index aaf1d63..85873a4 100644 --- a/Get-PC/Private/Apps.ps1 +++ b/Get-PC/Private/Apps.ps1 @@ -16,7 +16,7 @@ Function Get-Apps($ComputerName, $CompStatus, $TableView) { $apps += Get-Package | Add-Member -NotePropertyName Computer -NotePropertyValue $env:ComputerName -PassThru foreach ($app in ${using:SHSApps}) { - if (Test-Path $app.Path) { + if (Invoke-Expression $app.Test) { $apps += [PSCustomObject]@{ DisplayName = $app.DisplayName Computer = $env:ComputerName diff --git a/Get-PC/patchnotes.txt b/Get-PC/patchnotes.txt index a1b8bf3..1fa1316 100644 --- a/Get-PC/patchnotes.txt +++ b/Get-PC/patchnotes.txt @@ -1,3 +1,6 @@ +Patch +-Update Custom SHSApps have more robust detection + Patch 2025-4-29 -Fix DEL messages from SCCM queries now use the correct hostname -Update Removed HP campus from UserProfileBackup