If PowerShell throws an error message – The file cannot be loaded because script execution is disabled on this system, you need to enable the script running on your Windows 11/10 computer. The cause of this error is that your user account does not have sufficient permissions to run this script. This doesn’t mean you need to have admin level permissions, it also means you need to be free to run these types of PowerShell scripts or cmdlets
PowerShell cannot be loaded because script execution is disabled on this system
There is only one way to accomplish this task. You need to do is set the execution policy to be free.
For this, we will first check which policies are defined for individual user groups on your computer.
To do this, start by pressing WINKEY + X combo button or right-click the Start button and click Windows Powershell (Administrator) or search Powershell in the search field, right click on it and select Execute as administrator. Click on Yes for the UAC or User Account Control prompt you get. Then the Windows Powershell window will finally be opened. Now type the following command to get the list of execution rules for all scopes in your computer,
Get-ExecutionPolicy -List
This will put a list on user groups and their execution policy status.
Under the column of Scope, you have to look out Machine locale.
If you find that its execution policy is set to Indefinite Where Limit, you have tracked your issue.
Now the next thing you need to do is set the execution policy to Free.
For this you need to enter the following command in the same PowerShell session window,
Set-ExecutionPolicy Unrestricted
This will give you a message asking for various permissions for which you will need to either press Yes to say Yes to all messages individually or press the A key to say Yes to all messages at once.
If this command throws an error, you can also force the execution policy change by entering the following command,
Set-ExecutionPolicy Unrestricted -Force
This will finally set the execution policy for your PowerShell scripts and cmdlets. Free.
Now this should remove the error for you on powershell that says, The file cannot be loaded because script execution is disabled on this system.
Did this help you?