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.

Misc

The german error message is
Die Datei "‥" kann nicht geladen werden, da die Ausführung von Skripts auf diesem System deaktiviert ist. Weitere Informationen finden Sie unter "about_Execution_Policies".

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

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Windows/...', 1758760734, '216.73.216.19', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Windows/PowerShell/script-cannot-be-loaded-because-running-scripts-is-disabled-on-this-system(65): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78