Share via

Powershell is not letting me install any modules. It prompts error, elevation as an admin is required even though I initiate the session as an admin. And its not letting me install any modules. Please help. It started recently 2 months.

Anup Adhikari 0 Reputation points
2025-12-18T10:26:38.4466667+00:00

Powershell is not letting me install any modules. It prompts error, elevation as an admin is required even though I initiate the session as an admin. And its not letting me install any modules. Please help. It started recently 2 months. Exact situation:

Install-Module -Name PowerShellGet -Force -AllowClobber

WARNING: The version '1.4.8.1' of module 'PackageManagement' is currently in use. Retry the operation after closing the applications.

Install-Package: 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 tried with zero trust asessment module installation same situation.

install-module -name zerotrustassessment -Scope CurrentUser

Install-Package: 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).

install-module -name zerotrustassessment -Scope CurrentUser

Install-Package: Administrator rights are required to install or update. Log on to the computer with an account that has Administratorrights, 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 am unable to automate stuffs, it has been a very tough situation, anyone who experienced same and resolved it, please guide me.

Windows for business | Windows 365 Business
0 comments No comments

3 answers

Sort by: Most helpful
  1. Luis Bonilla 0 Reputation points
    2025-12-19T18:49:39.97+00:00

    For me this was being caused by the pwsh command being blocked by the built in Virus and Thread Protection component of Windows. To allow it I went to "Protection History" found the threat's and clicked one of them. From one of the drop down's in the thread I allowed the activity on my device to the path the install was trying to modify.

    Was this answer helpful?

    0 comments No comments

  2. Quinnie Quoc 10,560 Reputation points Independent Advisor
    2025-12-18T11:32:31.05+00:00

    Dear Anup Adhikari,

    Thank you for reaching out and providing detailed information about the issue you are experiencing when attempting to install PowerShell modules. Based on the symptoms you described, including repeated prompts for administrator rights and the warning that PackageManagement 1.4.8.1 is currently in use, this behavior aligns with known cases where the PackageManagement module becomes locked or corrupted, preventing module installation even in elevated sessions. This can occur when another process is using the module or when the module version conflicts with PowerShellGet. I recommend fully closing all PowerShell and related applications, then restarting the device to release any module locks. After that, try reinstalling PowerShellGet and PackageManagement, or run the installation using a clean elevated PowerShell session. If the issue persists, using -Scope CurrentUser may help, but in some cases a repair of PowerShellGet or resetting the PowerShell environment is required.

    If the guidance provided helps resolve your issue, I kindly ask that you mark the response as “Accept the answer”, as this will assist other users facing the same challenge.

    Thank you so much!!

    Please feel free to reach out again if you need further assistance.

    Kind regards,

    QQ.

    Was this answer helpful?

    0 comments No comments

  3. Q&A Assist
    2025-12-18T10:28:17.5066667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    It appears that you are facing issues with installing PowerShell modules due to permission errors, even when you are running PowerShell as an administrator. Here are some steps to help troubleshoot and potentially resolve the problem:

    1. Verify PowerShell Version: Ensure you are using PowerShell 5.0 or later, as earlier versions may have limitations regarding module installations. You can check your version by executing:
         $PSVersionTable.PSVersion
      
    2. Install with -Scope CurrentUser: Since you are receiving errors about needing administrator rights, try installing the module for the current user instead of all users. Use the -Scope CurrentUser parameter in your command:
         Install-Module -Name PowerShellGet -Scope CurrentUser -Force -AllowClobber
      
    3. Close Applications: The warning about the PackageManagement module being in use suggests that some applications might be utilizing it. Ensure that you close any applications that could be using PowerShell or related modules before trying the installation again.
    4. Check Execution Policy: Make sure your execution policy allows for module installations. You can check your current execution policy with:
         Get-ExecutionPolicy
      
      If it is too restrictive, you can temporarily change it with:
         Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
      
    5. Update PowerShellGet and PackageManagement: Updating the PowerShellGet and PackageManagement modules can sometimes resolve issues. You can do this using:
         Install-Module -Name PowerShellGet -Force -AllowClobber -Scope CurrentUser
         Install-Module -Name PackageManagement -Force -AllowClobber -Scope CurrentUser
      
    6. Reboot Your System: If the above steps do not resolve the issue, consider rebooting your computer. This can help clear any locks on the modules.

    If the problem continues after trying these solutions, you may want to check the event logs for any related errors or consult your IT department, as there might be group policies or other restrictions affecting your ability to install modules.


    References:

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.