PowerTip: Determine Size of PowerShell Console


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

Comments (3)

  1. Aswini S says:

    Very helpful. Thanks!

  2. Chen V says:

    In PowerShell ISE

    $psISE.Options.ConsoleTokenColors

    Displays color notes – Good to know this

  3. Chen V says:

    Alternatively in both ISE and PS host

    [console]::BufferHeight

    [console]::BufferWidth

    This should do the job

Skip to main content