We are setting $ErrorActionPreference = 'Continue' in all chocolateyuninstall.ps1 files, but the helper functions seems to use the $ErrorActionPreference = 'Stop in the first line of vm.common.psm1. Some of our helper functions like VM-Uninstall are using -ao 0 to ignore errors (as otherwise they would fail the uninstall), while we would like to get the errors but not fail the uninstallation so that as many steps as possible are performed.
Details
We are setting
$ErrorActionPreference = 'Continue'
in allchocolateyuninstall.ps1
files, but the helper functions seems to use the$ErrorActionPreference = 'Stop
in the first line ofvm.common.psm1
. Some of our helper functions likeVM-Uninstall
are using-ao 0
to ignore errors (as otherwise they would fail the uninstall), while we would like to get the errors but not fail the uninstallation so that as many steps as possible are performed.