Search notes:

PowerShell: script cannot be loaded because running scripts is disabled on this system

A PowerShell script should be run:
PS C:\> .\some-script.ps1
The shell responds with
some-script.ps1 cannot be loaded because running scripts is disabled on this system …
Googling around suggests to set the execution policy to something like remoteSigned:
PS C:\> set-executionPolicy remoteSigned
This time, the shell answers with
PS C:\> Access to the registry key 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell' is denied.
Of course, this is because it requires administrator privileges to change the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell and the user started PowerShell as an ordinary user only. Thus, he changes the execution policy for the himself (-scope currentUser):
PS C:\> set-executionPolicy remoteSigned -force -scope currentUser
And this now works, the shell says
HKCU\Software\Microsoft\Powershell\1\ShellIds\Microsoft.PowerShell value of `ExecutionPolicy` was set to `RemoteSigned`.
The script can now be run.

See also

The value of the execution policy can directly be changed in the registry under HKEY_CURRENT_USER\Software\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell, value ExecutionPolicy.

Index