Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Reformat the Window for PowerShell Web Access
function Set-PSWAWindowSize
Reformat the Window for PowerShell Web Access
This function reformats the PowerShell Web Access windows style to fit a bit better.
PS C:\> Set-PSWAWindowSize
I use PowerShell Web Access a lot while traveling. That comes handy,
because I don't need a working VPN and with an App (comes free from
Sapien) even triggering some long-running scripts from the iPad out of
a Hotel room as no longer a pain. And it doesn't use a lot of data.
Author: Joerg Hochwald -
This script is public domain! IT COMES WITH NO WARRANTY!
[CmdletBinding(SupportsShouldProcess = $true)]
param ()
if ($pscmdlet.ShouldProcess('PowerShell Window', 'Tweak it for PSWA usage'))
# Get the BufferSize
$bufferSize = $Host.UI.RawUI.BufferSize
# Tweak the BufferSize
$bufferSize.Width = 180
$Host.UI.RawUI.BufferSize = $bufferSize
# Get the WindowSize
$WindowSize = $Host.UI.RawUI.WindowSize
# Tweak the WindowSize
$WindowSize.Width = 180
$WindowSize.Height = 40
$Host.UI.RawUI.WindowSize = $WindowSize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.