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:
- Make sure you are running the PowerShell Script as an administrator, right click on the .psq file and select "Run as Administrator".
- Make sure the script is not blocked, to unblock right-clicking on the .ps1 script file, select "Properties" -> "Unblock" button in the "General" tab.
- Set the Execution Policy to RemoteSigned
- Run PowerShell as an administrator.
- Run the command: Set-ExecutionPolicy RemoteSigned
Try running the script again and it should work if the script is signed by a trusted publisher.
If the above steps do not work you will need to get the script initially signed to make sure you can run it without changing the Execution Policy.
Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!