Skip to content

Improvement: Optimize Appx uninstallation console output and prevent redundant logging #627

Description

@HetCreep

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:

  1. 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.
  2. 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.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions