Write-Output

noun

say it: “RYT OWT-put” /ˈraɪt ˈaʊtˌpʊt/

A PowerShell command that sends a result on to the next command, a variable or a file, rather than only to the screen.

What does Write-Output do?

Write-Output sends a result down the pipeline, where the next command, a variable or a > file gets it. Use it for results, such as the name of each receipt a script moved; text on a line of its own does the same.

# move-receipts.ps1 outputs each receipt it moved with Write-Output $file.Name
.\move-receipts.ps1 > moved.txt
Get-Content moved.txt
# 2026-10-03-groceries.pdf
# 2026-10-09-pharmacy.pdf

In a sentence

  • “The mover sends each receipt's name with Write-Output, so moved.txt holds only the names.”
  • “Because the script uses Write-Output, Measure-Object can count the receipts it moved.”

Level: Apprentice · More PowerShell terms at this level

Updated