13

Powershell error – Import-Module : File AzureRM.psm1 cannot be loaded because r...

 3 years ago
source link: https://sqlwithmanoj.com/2017/06/09/powershell-error-import-module-file-azurerm-psm1-cannot-be-loaded-because-running-scripts-is-disabled-on-this-system/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Home > Microsoft Azure, Powershell > Powershell error – Import-Module : File AzureRM.psm1 cannot be loaded because running scripts is disabled on this system

Powershell error – Import-Module : File AzureRM.psm1 cannot be loaded because running scripts is disabled on this system

After installing the AzureRM module, I tried to import it, but it gave me an error:

Import-Module : File C:\Program Files\WindowsPowerShell\Modules\AzureRM\4.0.2\AzureRM.psm1 cannot
be loaded because running scripts is disabled on this system. For more information, see
about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ Import-Module AzureRM
+ ~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [Import-Module], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess,Microsoft.PowerShell.Commands.ImportModuleComman
d

This error means that the AzureRM module downloaded from internet must be signed by a trusted publisher before they can be run.

–> Now to fix it you need to change the execution policy by this simple command:

PS c:\> Set-ExecutionPolicy RemoteSigned

If you are on PowerShell Window then it will throw a popup to confirm to change the Execution policy, you can choose “Yes”:

Now try running again the import command, it will run:

PS c:\> Import-Module AzureRM


Advertisements
Report this ad

Related

Leave a Reply Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK