如何在Windows 7中设置PowerShell默认窗口大小?


12

在Windows 7中,如何设置默认的PowerShell窗口大小?默认情况下,它对于我正在使用的上网本屏幕而言显得过高。

我尝试了通过单击左上角并选择“属性”的方法来更改大小,但是它告诉我:(Unable to modify the shortcut: . Check to make sure it has not been deleted or renamed.是的,错误消息的中间有一个点)

我还尝试右键单击“开始”菜单中的PowerShell快捷方式,然后在其中更改属性,但是,更改似乎没有停止。


Answers:


5

在您的个人资料(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   
}

然后调用该函数:

Set-WindowSize 100 50

谢谢。只要I Set-ExecutionPolicy unrestricted,它就可以工作,这有点令人担忧,但是我想我最终必须这样做才能在PowerShell下完成任何工作。
Nate

setting "WindowSize": "Window cannot be wider than the screen buffer.
villasv's


7

围棋Start- > All Programs- > Accessories- > Windows PowerShell。R单击您正在使用的那个。转到Layout标签,然后更改所需的设置。


2
对于PS的任何快捷方式(例如已将其固定到任务栏),此方法都很好。
James Skemp


-1

您可以尝试“属性”,“布局”选项卡,“窗口大小”。

我还可以抓住最右边的窗口,并以传统的Windows方式调整大小。

您可以尝试启动GUI替代方案:PowerShell ISE。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.