New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Progress Bar problems with Remove-AppxPackage #19022
Comments
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
I previously tried calling "Write-Progress - Activity 'dummy' -Complete" and that did not work. I also tried creating a new progress bar and clearing it, but the old progress bar remained. I also tried using pause right after the call and that did not protect the next ReadKey, which I was using to make a menu selection. The menu display was trashed. BTW, thanks for the better code idea, now using: |
Let's try to narrow this down:
It is plausible that the implicit remoting involved in direct calls to (the proxy commands for) the |
I just tested $global:ProgressPreference = 'SilentlyContinue' and it does prevent the progress bar from appearing. I looked in the documentation and saw nothing about when to specify global preference variables. I did find this came up over 3 years ago in https://github.com/PlagueHO/CosmosDB/issues/308. The script that I submitted was specifically written to demonstrate the problem and short enough to examine before running. The problem does not present itself outside of a script and describing how to write the script seemed too cumbersome. But I understand your reluctance, especially with the Administrator requirement to replace the deleted app. |
First, a meta comment:
|
The root problem is that the
In your case, since you're using an interactive feature that delays completion of the script - As for workarounds:
|
This issue has been marked as answered and has not had any activity for 1 day. It has been closed for housekeeping purposes. |
Thank you for that detailed resolution. I have reported this problem on the Feedback Hub as "Remove-AppxPackage does not close the progress bar". |
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
The text was updated successfully, but these errors were encountered: