Whenever I want to test execution of my script in the PowerShell ISE, the entire script gets echoed to the console before it executes. Then, any actual output from the script gets written starting on a line immediately afterward. This puts a lot of noise in the console, and can make it tricky to find where the script echo ends and the output begins.

Is there a way to disable this echoing of the script into the console?

  • Would Clear-Host be a suitable work-around?
    – Guy Thomas
    Jan 8, 2014 at 20:33
  • 1
    @GuyThomas I'd rather not. That would make it more difficult to compare output between subsequent runs of the script.
    – Iszi
    Jan 8, 2014 at 20:35
  • Running PowerShell ISE (x86) was my issue. Running the 64 bit version fix it. May 19, 2017 at 15:16

3 Answers 3


Save the script at least once. This will prevent the "script echo" of contents of the script. Instead, it will only echo the path to the saved script when you run the script for testing.


If you just want to make the onscreen output 'cleaner', just add:


at the top of your powershell script. This will clear the output in the console. The script will still be written onscreen momentarily but it will be cleared as soon as your code actually starts executing.

  • This is what I actually looked for. Thanks Apr 7, 2020 at 7:58
  • Simple, but works! Thanks! Aug 11, 2021 at 9:40

if you have a line, for example

cmd.exe /c "echo foo"

you can path it into null and therefore produce no output

cmd.exe /c "echo foo" > $null

so if you launch your .ps1 from the command line you can do something like this:

PS C:\Users\bodyi> foo.ps1 > $null
  • This doesn't fix the problem. This just removes the script's output, the script itself still gets printed.
    – 8bittree
    Aug 2, 2017 at 20:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.