As Craig suggested in https://github.com/elastic/elastic-agent/pull/5756#issuecomment-2405762282, we should add an option to skip the audit/unenroll call when the elastic-agent uninstalls.
Skipping the audit/unenroll call can be exposed to the end user through a flag used with the uninstall command.
The behaviour was added in #5302.
As Craig suggested in https://github.com/elastic/elastic-agent/pull/5756#issuecomment-2405762282, we should add an option to skip the audit/unenroll call when the elastic-agent uninstalls. Skipping the audit/unenroll call can be exposed to the end user through a flag used with the uninstall command. The behaviour was added in #5302.