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