PowerShell / PSResourceGet

PSResourceGet is the package manager for PowerShell
https://www.powershellgallery.com/packages/Microsoft.PowerShell.PSResourceGet
MIT License
486 stars 92 forks source link

Install-PSResource does not display error with access denied failure #456

Closed PaulHigin closed 2 years ago

PaulHigin commented 3 years ago

Prerequisites

Steps to reproduce

  1. Run PowerShell in a non-Admin Windows account.
  2. Run Install-PSResource with -Scope AllUsers and -Verbose switch.

Since non-Admin accounts do not have access permissions to install a module with AllUsers scope, the install fails, but no error is displayed.

Expected behavior

PS> Install-PSResource Microsoft.PowerShell.SecretStore -Repository PSGallery -Scope AllUsers -Verbose
Error: Cannot access install path...

Actual behavior

PS> Install-PSResource Microsoft.PowerShell.SecretStore -Repository PSGallery -Scope AllUsers -Verbose
...
VERBOSE: Unable to successfully install package 'Microsoft.PowerShell.SecretManagement': 'Access to the path '.nupkg.metadata' is denied.'
...

Error details

No response

Environment data

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Binary     3.0.11     beta       PowerShellGet                       {Find-PSResource, Get-InstalledPSResource, Get-PS…

Name                           Value
----                           -----
PSVersion                      7.2.0-preview.8
PSEdition                      Core
GitCommitId                    7.2.0-preview.8-36-g0a342601c8ce9527dac560a9e6709e7f70f2cd9c
OS                             Microsoft Windows 10.0.19043
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

anamnavi commented 2 years ago

This was resolved by PR: https://github.com/PowerShell/PowerShellGet/pull/525