PowerShell logo on light blue background with vertical lines

Q. How can I display output in Windows PowerShell?

Q. How can I display output in Windows PowerShell?

 A. This is a common question from folks who are used to using something like VBScript's WScript.Popup or WScript.Echo. There are a few choices. I like to use the Write-Debug cmdlet to display debug output. It's suppressed by default, since the shell's $DebugPreference variable is set to SilentlyContinue. Temporarily change it to Continue to enable debug output.

For normal output, you can use the Write-Host cmdlet to write directly to the screen or the Write-Output cmdlet to write to the pipeline. PowerShell doesn't include a graphical message box, although you could access one from within the .NET Framework. Doing so, however, kind of defeats the purpose of a command-line environment, right?

Do you have a Windows PowerShell question? Find more PowerShell FAQs, articles, and other resources at windowsitpro.com/go/DonJonesPowerShell.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.