Recently, I attempted to install the Azurerm module using the “Install-Module Azurerm” PowerShell command, but I encountered the error “Administrator rights are required to install modules.”
Administrator rights are required to install modules
Cause of this error
One important thing to note here is that you cannot install PowerShell modules using ‘install-module’ directly in the case of Azure PowerShell functions. This means that if you attempt to install any other modules that are not part of the default modules, it will not allow you to do so. Instead, it will display this error message.
Below is the exact error message I got
install-module: Administrator rights are required to install modules in ‘C:\Program Files\WindowsPowerShell\Modules’. Log on to the
computer with an account that has Administrator rights, and then try again, or install
‘C:\Users\Bijay\Documents\WindowsPowerShell\Modules’ by adding “-Scope CurrentUser” to your command. You can also try running the Windows
PowerShell session with elevated rights (Run as Administrator).
At line:1 char:1
- install-module azurerm
~~~~~~- CategoryInfo : InvalidArgument: (:) [Install-Module], ArgumentException
- FullyQualifiedErrorId: InstallModuleNeedsCurrentUserScopeParameterForNonAdminUser, Install-Module
You can see it here

Since the install module points directly to the PowerShell environment directory, and we don’t have access to it, we are getting this error message.
Solution
Follow the steps below to solve this error.
- Close the Current PowerShell window or session.
- Open PowerShell ISE with Run as Administrator mode.

3. Now try rerunning the command; you should encounter no issues this time. Check out the screenshot below.

Voila !!! This is how you can fix the error “Administrator rights are required to install modules.” Thanks for reading this article !!!

I am Rajkishore, and I am a Microsoft Certified IT Consultant. I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machines, Logic Apps, PowerShell Commands, CLI Commands, Machine Learning, AI, Azure Cognitive Services, DevOps, etc. Not only that, I do have good real-time experience in designing and developing cloud-native data integrations on Azure or AWS, etc. I hope you will learn from these practical Azure tutorials. Read more.
