Skip to content

Add dry-run mode to BCU-console uninstall command - #968

Open
hazeliscoding wants to merge 1 commit into
BCUninstaller:masterfrom
hazeliscoding:console-dry-run
Open

Add dry-run mode to BCU-console uninstall command#968
hazeliscoding wants to merge 1 commit into
BCUninstaller:masterfrom
hazeliscoding:console-dry-run

Conversation

@hazeliscoding

Copy link
Copy Markdown
Collaborator

Fixes #947

Adds an opt-in /N switch (--dry-run also accepted) to the uninstall subcommand that previews the operation without making any changes:

  • Runs the same application discovery and uninstall-list resolution as a real run.
  • Prints each matched application with its uninstaller kind and the exact uninstall command line that would be executed (respecting /Q quiet-uninstaller selection).
  • With /J=<Level>, also runs the junk scan and prints each junk item with its confidence that would be deleted at that level, with a note that pre-uninstall results may differ from the actual post-uninstall cleanup.
  • Performs no registry writes, no file deletions, and no process kills, and skips all confirmation prompts, so it is safe for unattended/scripted use.
  • Exits 0 on a successful preview, 1 if the list matches no applications.

Without the switch, behavior is unchanged.

@Klocman Klocman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the existing simulation functionality should be used. BulkUninstallConfiguration takes a simulate parameter which will prevent actually uninstalling the application.

Instead of adding a completely separate code branch that acts differently from the real branch, the simulation mode should be included in RunUninstall.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BCU-console: add --dry-run / /N no-op flag for uninstall and junk cleanup

2 participants