# Writing to Files: Set-Content, Add-Content and >

Set-Content writes a file, replacing whatever it held, Add-Content adds lines to its end, and > and >> save a command's output into a file the same two ways, in UTF-8 text.

![Cheat sheet for the lesson Writing to Files: Set-Content, Add-Content and >: Set-Content writes a file, replacing whatever it held, Add-Content adds lines to its end, and > and >> save a command's output into a file the same two ways, in UTF-8 text.](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/4ae9cebccd9044b58281f8c29583a9fd.webp)

- Category: PowerShell
- Level: Novice
- Tags: add-content, operating-system, out-file, powershell, redirection, set-content, text-encoding
- Updated: November 10, 2026

Source: https://www.ask-codey.com/cheat-sheets/powershell-writing-to-files-cheat-sheet
