Home » Questions » Computers [ Ask a new question ]

How can I set the PowerShell default window size in Windows 7?

How can I set the PowerShell default window size in Windows 7?

In Windows 7, how can I set the default PowerShell window size? By default it comes up too tall for the netbook screen I am working with.

Asked by: Guest | Views: 72
Total answers/comments: 2
Guest [Entry]

"Use a function like this in your profile (notepad $profile)

Function Set-WindowSize {
Param([int]$x=$host.ui.rawui.windowsize.width,
[int]$y=$host.ui.rawui.windowsize.heigth)

$size=New-Object System.Management.Automation.Host.Size($x,$y)
$host.ui.rawui.WindowSize=$size
}

Then call the function:

Set-WindowSize 100 50"
Guest [Entry]

Another approach is to run Powershell as an administrator. See How do I modify the Powershell console settings in Windows 7?