Skip to content

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

@codedChaos

Description

@codedChaos

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions