Currently, when executing the script's Appx removal features, the console prints Removing <AppId> for every app in the removal list, regardless of whether the app is actually installed on the system or has already been uninstalled. This clutters the console logs with redundant and misleading logs.
This improvement:
- Pre-fetch Appx cache: Pre-fetches the list of currently installed and provisioned packages in a single fast batch query at the beginning of the removal function.
- Existence checks: Checks each app against the pre-fetched cache, skipping the uninstallation commands and avoiding printing
Removing <AppId> if the package is already missing.
- Query Success Fallback: Gracefully degrades by falling back to standard uninstallation if the pre-fetch query fails (e.g. registry/service errors), preventing silent uninstallation skips.
Currently, when executing the script's Appx removal features, the console prints
Removing <AppId>for every app in the removal list, regardless of whether the app is actually installed on the system or has already been uninstalled. This clutters the console logs with redundant and misleading logs.This improvement:
Removing <AppId>if the package is already missing.