Search notes:

System.IO.File::ReadAllText

System.IO.File::ReadAllText slurps the content of an entire file and returns it as a System.String object.
The first parameter specifies the path to the file to be read.
The optional second parameter is a System.Text.Encoding object that specifies the file's encoding.

Change a file's encoding

ReadAllText along with WriteAllText can be used to change the encoding of a file:
$absolute_path = convert-path .\readme.txt
$content = [IO.File]::ReadAllText($absolute_path, [System.Text.Encoding]::GetEncoding('iso-8859-1'))
[IO.File]::WriteAllText($absolute_path, $content, [Text.Encoding]::UTF8)

See also

ReadAllBytes() and WriteAllBytes()
System.Text.Encoding
The PowerShell cmdlet get-content allows to read the entire content of a file with the -raw parameter.
ReadAllText in combination with WriteAllText might be used to change line endings in a file from DOS convention to UNIX convention, or vice versa.

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/Microsof...', 1758194008, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Microsoft/dot-net/namespaces-classes/System/IO/File/ReadAllText/index(59): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78