PowerShell offers you a multitude of ways to write information to disk. Here's a quick overview.
1. You can use classic redirection:
"Append this" >> $hometestfile.txt
This way, you have no control over encoding, though.
2. To control encoding, use Set-Content:
"Add this" | Add-Content $hometestfile.txt -Encoding Unicode
Just make sure you use the same encoding for everything you add to a single file.
3. Or you can use Out-File:
"Add this" | Out-File $hometestfile.txt -encoding Unicode -append
4. Finally, you can use native applications and tools like fsutil. The next line creates a blank text file with a size of 1,000 bytes:
You should note, however, that tools like fsutil require administrator privileges.