Add-Content

noun

say it: “AD KON-tent” /ˈæd ˈkɑntɛnt/

A PowerShell command that adds lines to the end of a file and keeps everything already in it.

What does Add-Content do?

Add-Content adds lines to the end of a file and keeps everything already in it, the safe way to grow a list or a log. If the file isn't there yet, it makes it. To replace the whole file instead, use Set-Content.

Add-Content todo.txt '- water the plants'

In a sentence

  • “Each time a box was carried up, the script used Add-Content to log one more line.”
  • “Sam used Add-Content to put "water the plants" at the bottom of her list.”

Level: Novice · More PowerShell terms at this level

Updated