Skip to content

Exception when attempting PackageManagement upgrade #1721

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

Closed
mavaddat opened this issue Feb 20, 2022 · 1 comment · Fixed by #1735
Closed

Exception when attempting PackageManagement upgrade #1721

mavaddat opened this issue Feb 20, 2022 · 1 comment · Fixed by #1735
Labels

Comments

@mavaddat
Copy link

The issue is that PowerShell produces an exception System.ComponentModel.Win32Exception,Microsoft.PowerShell.Commands.RemoveItemCommand,Microsoft.PowerShell.Package Management.Cmdlets.InstallPackage when running the update package manager upon being prompted by the PowerShell VS Code extension (v2021.12.0).

  • PowerShell suggests upgrading PackageManager due to a security vulnerability:

You have an older version of PackageManagement known to cause issues with the PowerShell extension. Would you like to update PackageManagement (You will need to restart the PowerShell extension after)?

  • I accept this recommendation.
  • PowerShell produces the following error:
PackageManagement\Install-Package : Access to the cloud file is denied                                                                           At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 char:21                                                   
+ ...          $null = PackageManagement\Install-Package @PSBoundParameters
+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
    + FullyQualifiedErrorId : System.ComponentModel.Win32Exception,Microsoft.PowerShell.Commands.RemoveItemCommand,Microsoft.PowerShell.Package 
   Management.Cmdlets.InstallPackage

image

@SeeminglyScience
Copy link
Collaborator

Turns out in preview we don't actually need to upgrade PackageManagement at all, so we're just going to take the prompt out instead 🎉

@mavaddat mavaddat closed this as completed Mar 2, 2022
Repository owner moved this from Todo to Done in Sea Biscuit Mar 2, 2022
andyleejordan pushed a commit that referenced this issue Mar 10, 2022
The reason we attempted to update `PackageManagement` is no longer applicable
(the deadlock has been fixed) so now we don't have to won this logic.

Fixes #1576 and #1721.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
3 participants