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

Can't Install-Module even with elevated prompt #98

Open
codedChaos opened this issue Apr 18, 2020 · 2 comments
Open

Can't Install-Module even with elevated prompt #98

codedChaos opened this issue Apr 18, 2020 · 2 comments

Comments

@codedChaos
Copy link

image

With -scope set to CurrentUser or AllUsers, the install-module PScribo command fails with:

Install-Package: C:\program files\powershell\7\Modules\PowerShellGet\PSModule.psm1:9685
Line |
9685 |  … 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).

I have administrator permissions on the machine, but it is a company laptop.

PowerShell Version:

PS C:\Users\username\Documents\WindowsPowerShell\Modules> $PSVersionTable.PSVersion

Major  Minor  Patch  PreReleaseLabel BuildLabel
-----  -----  -----  --------------- ----------
7      0      0

The install is successful for -Scope AllUsers when using the PowerShell version 5.1

@iainbrighton
Copy link
Owner

@devopsmyth Sorry - I appear to have completely missed this one.

I think this is a PowerShell 7/PackageManagement issue - nothing to do with PScribo. Are you running your PowerShell 7 session elevated?

@codedChaos
Copy link
Author

I was using Administrator elevated PWSH session. I'll test again since it's been a while. If you don't hear back from me in the next few days. Feel free to close this or I'll do it the next time I think about it.

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

2 participants