Search notes:

PowerShell module filesystem: write-file

The function write-file of the module filesystem creates or overwrites a file whose content is given as a string. Necessary paths of the destination directory are created:
write-file $destFile $content
write-file $destFile $content $encoding
Some examples:
write-file C:\users\rene\test\more\test\test\test.txt "one`ntwo`nthree"
write-file ./foo/bar/baz/utf8.txt      "Bärlauch"
write-file ./foo/bar/baz/win-1252.txt  "Bärlauch`nLiberté, Fraternité, Kamillentee"  ( [System.Text.Encoding]::GetEncoding(1252) )

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/write-file(41): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78