powershell script to file code example
Example 1: powershell write to file
Add-Content FilePath TextAdded
Example 2: powershell output to file
ls | Out-File -FilePath c:\PATH\TO\FOLDER\OUTPUT.txt
Add-Content FilePath TextAdded
ls | Out-File -FilePath c:\PATH\TO\FOLDER\OUTPUT.txt