我是PowerShell的新手,正在为我认为应该是一个简单的操作而苦苦挣扎-我正试图从命令行启动一个PowesShell窗口。
如果我启动一个命令行实例并输入powershell
或start powershell
,我会在命令行界面中得到一个PowerShell实例,即典型的黑色背景和白色文本。我想要的是典型的PowerShell界面启动-蓝色背景和白色文本?我正在运行安装了PowerShell 2.0的Windows XP。
发布于 2011-12-30 02:18:37
设置默认控制台颜色和字体:
来自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
发布于 2011-12-30 01:09:48
颜色和窗口大小由快捷方式LNK文件定义。我想我找到了一种方法,可以满足你的需求,试试这个:
explorer.exe "Windows PowerShell.lnk"
LNK文件位于所有用户开始菜单中,该菜单位于不同的位置,具体取决于您使用的是XP还是Windows 7。在7中,LNK文件位于以下位置:
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Accessories\Windows PowerShell
https://stackoverflow.com/questions/8670001
复制相似问题