guyrleech

Change PowerShell output width

Feb 4th, 2021 (edited)
1,094
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ## Useful when using PowerShell in Containers
  2. [int]$width = 170 ## slightly less than the window width (columns)
  3. if( ( $UI = (Get-Host).UI.RawUI ) -and ( $buffy = $UI.BufferSize ) )
  4. {
  5.     $buffy.Width = $width
  6.     $UI.BufferSize = $buffy
  7. }
Add Comment
Please, Sign In to add comment