14

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.

I have tried the usual way of changing the size—by clicking in the upper-left corner and choosing “Properties”—but it tells me: Unable to modify the shortcut: . Check to make sure it has not been deleted or renamed. (yes, there is a dot in the middle of the error message)

I also tried right-clicking on the PowerShell shortcut in the Start menu and changing properties there, however, the changes don’t seem to stick.

Nate
  • 4,083
  • 5
  • 26
  • 25

4 Answers4

12

Go Start -> All Programs -> Accessories -> Windows PowerShell. RClick on the one you're using. Go to the Layout tab, and change the settings you want.

Jay Bazuzi
  • 4,160
  • 6
  • 32
  • 41
6

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
Oliver Salzburg
  • 86,445
  • 63
  • 260
  • 306
Jeffery Hicks
  • 204
  • 1
  • 4
  • Thanks. This works, as long as I `Set-ExecutionPolicy unrestricted`, which is a little worrisome, but I guess I would have to do it eventually to get anything done under PowerShell. – Nate Nov 09 '09 at 17:46
  • `setting "WindowSize": "Window cannot be wider than the screen buffer.` – villasv May 14 '16 at 04:59
  • As for where the $profile file is... https://blogs.technet.microsoft.com/heyscriptingguy/2012/05/21/understanding-the-six-powershell-profiles/ – Glen Little Jan 24 '18 at 23:58
4

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

Kristopher Johnson
  • 1,770
  • 5
  • 21
  • 32
-1

You could try Properties, Layout tab, Window Size.

I was also able to grap the top RIGHT most window and re-size in the traditional Windows way.

You could try launching the GUI alternative: PowerShell ISE.

Guy Thomas
  • 3,288
  • 10
  • 35
  • 48