Does PowerShell has something like "echo off" and "echo on" trigger?

vik santata picture vik santata · Jun 18, 2015 · Viewed 68.2k times · Source

cmd/batch file could turn on and turn off "echo". So in PowerShell, I have a bunch of "write-host" output, I want somewhere to turn on / off write-host for debugging convenience.

Does PowerShell has such a function?

Answer

vonPryz picture vonPryz · Jun 18, 2015

The Set-PSDebug cmdlet has -Trace <int> parameter that can be used to same effect as echo on.