Fix PowerShell - .ps1 cannot be loaded because running scripts is disabled on this system


Error:

PS C:\Users\Code2care\Desktop> my-ps-script.ps1

C:\Users\Code2care\Desktop\my-ps-script.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.

...

+ CategoryInfo :SecurityError: (:) LJ, PSSecurityException

+ FullyQualifiedErrorId : UnauthorizedAccess

One of the major reasons for the PowerShell script cannot be loaded error is that the script that is being tried to be executed is not signed.

The other reason could be that the PowerShell execution policy is set to "Restricted" or "AllSigned" on your Windows OS (8/9/10/11) or Server.


Ways to fix the error:



















Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap