首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何从命令行启动PowerShell (不是脚本)

如何从命令行启动PowerShell (不是脚本)
EN

Stack Overflow用户
提问于 2011-12-29 23:53:02
回答 2查看 186.5K关注 0票数 23

我是PowerShell的新手,正在为我认为应该是一个简单的操作而苦苦挣扎-我正试图从命令行启动一个PowesShell窗口。

如果我启动一个命令行实例并输入powershellstart powershell,我会在命令行界面中得到一个PowerShell实例,即典型的黑色背景和白色文本。我想要的是典型的PowerShell界面启动-蓝色背景和白色文本?我正在运行安装了PowerShell 2.0的Windows XP。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2011-12-30 02:18:37

设置默认控制台颜色和字体:

http://poshcode.org/2220

来自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
票数 15
EN

Stack Overflow用户

发布于 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
票数 11
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8670001

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档