Prerequisites
Steps to reproduce
This script will demonstrate the problem by removing and re-installing the Calculator app. (It requires Administrator privileges to be able to re-install the app.)
BugInRemove-AppxPackage.zip
The work-around to re-displaying the progress bar is to run the cmdlet in a new shell. e.g.
$Env:AppxPackageName = $AppxPackage.Name
. (Get-Process -Id $PID).Processname -Command 'Get-AppxPackage $Env:AppxPackageName | Remove-AppPackage'
Expected behavior
The progress bar should honor the ProgressPreference and never re-display after the cmdlet completes.
Actual behavior
Remove-AppxPackage does not honor $ProgressPreference = 'SilentlyContinue'.
Then, the progress bar is re-displayed and remains in view if the command is followed by [System.Console]::ReadKey().
These are probably two seperate bugs, but tied closely together.
Error details
No response
Environment data
The problem exists in V5.1 and V7.3.1
Visuals
No response
Prerequisites
Steps to reproduce
This script will demonstrate the problem by removing and re-installing the Calculator app. (It requires Administrator privileges to be able to re-install the app.)
BugInRemove-AppxPackage.zip
The work-around to re-displaying the progress bar is to run the cmdlet in a new shell. e.g.
$Env:AppxPackageName = $AppxPackage.Name. (Get-Process -Id $PID).Processname -Command 'Get-AppxPackage $Env:AppxPackageName | Remove-AppPackage'Expected behavior
The progress bar should honor the ProgressPreference and never re-display after the cmdlet completes.Actual behavior
Error details
No response
Environment data
Visuals
No response