Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 400
vik santata Avatar asked Jun 18 '15 07:06

vik santata


People also ask

Does PowerShell have echo off?

PowerShell does not echo commands like Cmd.exe, so there's no need for the @Echo Off command in PowerShell.

What does @echo off do?

The ECHO-ON and ECHO-OFF commands are used to enable and disable the echoing, or displaying on the screen, of characters entered at the keyboard. If echoing is disabled, input will not appear on the terminal screen as it is typed. By default, echoing is enabled.

How do I enable debug mode in PowerShell script?

Press F5 or, on the toolbar, click the Run Script icon, or on the Debug menu, click Run/Continue or, in the Console Pane, type C and then press ENTER . This causes the script to continue running to the next breakpoint or to the end of the script if no further breakpoints are encountered.

How do I pause in PowerShell?

The most popular command to pause in PowerShell is the Start-Sleep command or cmdlet. Also, the Start-Sleep command is the official and native command provided by PowerShell.


1 Answers

I recommend you simply put

| Out-Null

at the end of any line where privacy matters... it's more or less the same as putting...

@

... at the beginning of any 'batch' line where you want output hidden from users.

like image 164
Hardryv Avatar answered Oct 25 '22 14:10

Hardryv