Proper removal is not just deleting files:
$proc = Start-Process -FilePath "msiexec.exe" -ArgumentList $arguments -Wait -PassThru if ($proc.ExitCode -eq 0 -or $proc.ExitCode -eq 3010) Write-Host "Success or reboot required." exit 0 else Write-Error "Install failed with exit code $($proc.ExitCode)" exit $proc.ExitCode