Skip to content
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

Invoke-PSDepend -Target CurrentUser giving error asking for elevation #130

Open
JohnLudlow opened this issue May 11, 2021 · 0 comments
Open

Comments

@JohnLudlow
Copy link

I am getting this error when using Invoke-PSDepend:

> invoke-psdepend -Confirm:$false -Target CurrentUser
Install-Package: C:\program files\powershell\7\Modules\PowerShellGet\PSModule.psm1:9711
Line |
9711 |  … talledPackages = PackageManagement\Install-Package @PSBoundParameters
     |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Administrator rights are required to install or update. Log on to the computer with an account that has Administrator rights, and then try
     | again, or install by adding "-Scope CurrentUser" to your command. You can also try running the Windows PowerShell session with elevated
     | rights (Run as Administrator).

The workaround is probably to run from an elevated shell

My PowerShell version:

Name                           Value
----                           -----
PSVersion                      7.1.3
PSEdition                      Core
GitCommitId                    7.1.3
OS                             Microsoft Windows 10.0.19042
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Interestingly I don't seem to get the same behaviour on PowerShell 7.2.0-preview5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant