Hi all, we are experiencing an error popup for users when running PSADT in silent mode and are wondering how to suppress this popup.
[Pre-Installation] :: Error Record:
Message : Removal failed. Please contact your software vendor.
Deployment DeStage operation with target volume C: on Package
Microsoft.Microsoft3DViewer_7.2105.4012.0_x64__8wekyb3d8bbwe from: failed with error 0x80070002.
See http://go.microsoft.com/fwlink/?LinkId=235160 for help diagnosing app deployment issues.
InnerException :
FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,Microsoft.Windows.Appx.PackageManager.Commands.Remo
veAppxPackageCommand
ScriptStackTrace : at , C:\WINDOWS\ccmcache\1r\Deploy-Application.ps1: line 161
at , : line 1
at , : line 1
[Pre-Installation] :: Display Dialog Box with message: Error Record:
Message : Removal failed. Please contact your software vendor.
Deployment DeStage operation with target volume C: on Package
Microsoft.Microsoft3DViewer_7.2105.4012.0_x64__8wekyb3d8bbwe from: failed with error 0x80070002.
See http://go.microsoft.com/fwlink/?LinkId=235160 for help diagnosing app deployment issues.
InnerException :
FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,Microsoft.Windows.Appx.PackageManager.Commands.Remo
veAppxPackageCommand
ScriptStackTrace : at , C:\WINDOWS\ccmcache\1r\Deploy-Application.ps1: line 161
at , : line 1
at , : line 1
Would the answer be to remark out the line âShow-DialogBox -Text $mainErrorMessage -Icon âStopââ line in the â##* END SCRIPT BODYâ section? If so perhaps some logic should be added to not display a messagebox if running in silent mode.
Maybe but it seems like your line 161 is the issue.
If the following is your line 161:
$InstalledUserApp | Remove-AppxPackage -AllUsers
I suspect the problem is whatâs in $InstalledUserApp .
Is it empty? Is it good?
We canât tell because you skimped on the logging.
See below on how to add it to the Remove-AppxPackage command:
As for determining whatâs in $InstalledUserApp , you might be able to add an additional line before line 161 to log its contents. Iâm assuming itâs an array so this should work:
Write-log "Contents of InstalledUserApp [$($InstalledUserApp | Out-string)]"
The root cause of the error is because an appx package is failing to be removed, I wanted to focus this post about a UI prompt coming up in silent mode which isnât desired.
Here is the simplified PS code for the appx uninstall:
$ProvisionedAppName = âMicrosoft.Microsoft3DViewerâ
Get-AppxPackage -Name $UserAppName -AllUsers
ForEach ($InstalledUserApp in $InstalledUserApps)
{$InstalledUserApp | Remove-AppxPackage -AllUsers}
This step is failing -
Message : Removal failed. Please contact your software vendor.
Deployment DeStage operation with target volume C: on Package
Microsoft.Microsoft3DViewer_7.2105.4012.0_x64__8wekyb3d8bbwe from: failed with error 0x80070002.
See http://go.microsoft.com/fwlink/?LinkId=235160 for help diagnosing app deployment issues.
Itâs possible, although my primary concern was the popup when PSADT is being run silently. We have remarked out the line âShow-DialogBox -Text $mainErrorMessage -Icon âStopââ line in the â##* END SCRIPT BODYâ and it seems to have done the trick.
We have a separate app that installs per user the latest appx package, once that occurs the old one is removed correctly.