Repair-WinGetPackageManager does not detect provisioned but not registered state #4603
Labels
Issue-Bug
It either shouldn't be doing this or needs an investigation.
PowerShell
Issue related to WinGet PowerShell Module or cmdlet
Brief description of your issue
Repair-WinGetPackageManager does not detect the state where the package has been provisioned for the machine but not registered for the user. This may lead to a failure if the provisioning step does an async registration that does not complete before we attempt to check for the registration side effects.
Detecting this state is complicated by the fact that there is no obvious way to use the PS commands to find a staged package without elevation. If we are running elevated, we can add
-AllUsers
to the existing check as a fix. If not, we either need to request changes toGet-AppxPackage
or find another mechanism.Steps to reproduce
Provision the package, then remove it for the user. Note that the repair state machine will detect this as "not installed" rather than "not registered".
Expected behavior
The repair state machine registers the package.
Actual behavior
The repair state machine determines "not installed", leading to unnecessary downloads or an error if the provisioning of the previous state didn't register for the user in time.
Environment
The text was updated successfully, but these errors were encountered: