0

I want to echo output to Powershell stdout. The suggested methods of using Write-Host (Debug/Versbose) writes to console as expected but when I redirect the output to a file with >> it keeps writing to the console.

What is the full equivalient to "echo" in Powershell? Echo works but the use of it is discouraged from my code editor (VS Code).

3
  • 2
    Does this answer your question? Echo equivalent in PowerShell for script testing Commented Jan 14, 2021 at 9:11
  • 1
    Does this answer your question? How to output something in PowerShell Commented Jan 14, 2021 at 9:24
  • @Cililing This isn't a good dupe, because the accepted answer deals only with outputting something to the console / debug / verbose streams. OP requires that output be redirectable which requires output to the success stream. Commented Jan 14, 2021 at 9:59

1 Answer 1

2

echo in PowerShell is just an alias to Write-Output, and you can always use it instead of its alias.

The reason why Visual Studio Code discouraged you to use echo is just because that aliases will downgrade you code's readibility.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.