czu*_*ski 23 powershell powershell-2.0
我是PowerShell的新手,我正在努力解决我认为应该是一个简单的操作 - 我试图从命令行启动一个PowesShell窗口.
如果我启动一个命令行实例并输入powershell或者start powershell,我在命令行界面中获得一个PowerShell实例,即带有白色文本的典型黑色背景.我想要的是典型的PowerShell界面启动蓝色背景白色文本?我正在运行安装了PowerShell 2.0的Windows XP.
Ryn*_*ant 33
如果您在Windows资源管理器中转到C:\Windows\system32\Windowspowershell\v1.0(并C:\Windows\syswow64\Windowspowershell\v1.0在x64计算机上)并双击,powershell.exe您将看到它以黑色背景打开PowerShell.从开始菜单打开时,PowerShell控制台显示为蓝色,因为powershell.exe可以独立于默认属性设置快捷方式的控制台属性.
要设置默认选项,字体,颜色和布局,请打开PowerShell控制台,键入Alt-Space,然后选择"默认"菜单选项.
start powershell从cmd.exe 运行应该使用默认设置启动新控制台.
Sha*_*evy 15
设置默认控制台颜色和字体:
http://poshcode.org/2220
来自
Lee Holmes的Windows PowerShell Cookbook(O'Reilly)(http://www.leeholmes.com/guide)
Set-StrictMode -Version Latest
Push-Location
Set-Location HKCU:\Console
New-Item '.\%SystemRoot%_system32_WindowsPowerShell_v1.0_powershell.exe'
Set-Location '.\%SystemRoot%_system32_WindowsPowerShell_v1.0_powershell.exe'
New-ItemProperty . ColorTable00 -type DWORD -value 0x00562401
New-ItemProperty . ColorTable07 -type DWORD -value 0x00f0edee
New-ItemProperty . FaceName -type STRING -value "Lucida Console"
New-ItemProperty . FontFamily -type DWORD -value 0x00000036
New-ItemProperty . FontSize -type DWORD -value 0x000c0000
New-ItemProperty . FontWeight -type DWORD -value 0x00000190
New-ItemProperty . HistoryNoDup -type DWORD -value 0x00000000
New-ItemProperty . QuickEdit -type DWORD -value 0x00000001
New-ItemProperty . ScreenBufferSize -type DWORD -value 0x0bb80078
New-ItemProperty . WindowSize -type DWORD -value 0x00320078
Pop-Location
Run Code Online (Sandbox Code Playgroud)
And*_*ndi 11
颜色和窗口大小由快捷方式LNK文件定义.我想我找到了一种可以做你需要的方法,试试这个:
explorer.exe "Windows PowerShell.lnk"
Run Code Online (Sandbox Code Playgroud)
LNK文件位于所有用户开始菜单中,根据您的XP或Windows 7,它位于不同的位置.在7中,LNK文件位于:
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Accessories\Windows PowerShell
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
182607 次 |
| 最近记录: |