Search notes:

PowerShell error message: The 'xxx' command was found in the module 'xxx', but the module could not be loaded.

Trying to run a PowerShell command results in an error:
xyz : The 'get-xyz' command was found in the module 'xyz', but the module could not be loaded. For more information,
run 'Import-Module xyz'.
At C:\Users\Rene\bla.ps1:76 char:6
The message recommends to import the module, which only results in yet another error message:
PS C:\Users\Rene> import-module xyz
import-module : File …\…\xyz.psm1 cannot be loaded. The file …\…\xyz.psm1 is not digitally
signed. You cannot run this script on the current system. For more information about running scripts and setting execution policy, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
The (or at least one of the) solution(s) is to unblock the file:
PS C:\Users\Rene> unblock-file …\…\xyz.psm1

TODO

2025-08-08: When I tried to execute a PowerShell script (not a module) on a «new» machine, I got P:\ath\to\script.ps1 : File P:\ath\to\script.ps1 cannot be loaded. The file P:\ath\to\script.ps1 is not digitally signed. You cannot run this script on the current system. For more information about running scripts and setting execution policy, see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170.
Unblocking the script didn't help in this case, but the following command did:
set-executionPolicy -scope process -executionPolicy bypass -force

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/...', 1759406330, '216.73.216.42', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Windows/PowerShell/modules/The-xyz-command-was-found-in-the-module-xyz_but-the-module-could-not-be-loaded(54): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78