Categories
Windows

Solve Profile PS1 cannot be loaded UnauthorizedAccess

If you have this error when opening CMD, Powershell or terminal

WindowsPowerShell\profile.ps1 cannot be loaded because running scripts is disabled on
this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:3
+ . 'C:\Users\dev\Documents\WindowsPowerShell\profile.ps1'
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

The quick fix is open “Powershell” with administrator access and execute this command

Set-ExecutionPolicy Unrestricted

Leave a Reply

Your email address will not be published. Required fields are marked *