PowerTip: Determine Size of PowerShell Console

PowerTip: Determine Size of PowerShell Console

  • Comments 3
  • Likes

Summary: Determine how large your Windows PowerShell console is.

Hey, Scripting Guy! Question How can I see how large my Windows PowerShell console is?

Hey, Scripting Guy! Answer Access the WindowSize property from the $Host object:

$Host.UI.RawUI.WindowSize.Width

$Host.UI.RawUI.WindowSize.Height

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Very helpful. Thanks!

  • In PowerShell ISE

    $psISE.Options.ConsoleTokenColors

    Displays color notes - Good to know this

  • Alternatively in both ISE and PS host

    [console]::BufferHeight

    [console]::BufferWidth

    This should do the job