Reading and writing files is a core skill. PowerShell makes this easy with simple cmdlets.
Out-File
Add-Content
Get-Content