Search notes:

PowerShell module filesystem: initialize-emptyDirectory

The function initialize-emptyDirectory of the module filesystem creates an empty directory and returns the corresponding System.IO.DirectoryInfo object.
If $dir already exists, it is removed (including content) and re-created. If the directory cannot be removed, the function returns $null
$dir_obj = initialize-emptyDirectory 'P:/ath/to/directory'
if ($dir -eq $null) {
   write-host 'Could not remove directory, possibly because it is still used by another process'
}

do-somethingWith $dir_obj

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/...', 1758207103, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Windows/PowerShell/modules/personal/filesystem/initialize-emptyDirectory(42): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78