place app tracking above loop

This commit is contained in:
2023-01-18 19:38:18 -05:00
parent 1c4aa415e1
commit 8ace59d30a
+3 -3
View File
@@ -11,6 +11,9 @@ Function Get-GUIDFromMSIUninstallString {
Return $str.Substring($start, $end - $start)
}
# Track whether an app was uninstalled or not
$PRODUCTUNINSTALLED = $false
Foreach ( $reg in $UNINSTALL_KEYS ) {
# Get the uninstall key
$REG_PROPERTY = Get-ItemProperty -Path $reg.PSPath
@@ -24,9 +27,6 @@ Foreach ( $reg in $UNINSTALL_KEYS ) {
# Get the ModifyPath
$MODIFYPATH = $REG_PROPERTY.ModifyPath
# Track whether an app was uninstalled or not
$PRODUCTUNINSTALLED = $false
# Make sure the DisplayName matches what we're looking for
If ( $DISPLAY_NAME -ilike $APP_NAME ) {
# Make sure the software was installed using an MSI