web-dev-qa-db-ja.com

コマンドラインからPowerShell(スクリプトではない)を起動する方法

私はPowerShellを初めて使い、単純な操作であると想定していることに苦労しています。コマンドラインからPowesShellウィンドウを起動しようとしています。

コマンドラインインスタンスを起動し、powershellまたはstart powershell、コマンドラインインターフェイス内でPowerShellインスタンスを取得しています。つまり、典型的な黒い背景に白いテキストが含まれています。私が望むのは、典型的なPowerShellインターフェイスを起動することです。青色の背景に白色のテキストがありますか? PowerShell 2.0がインストールされたWindows XPを実行しています。

23
czuroski

デフォルトのコンソールの色とフォントを設定します。

http://poshcode.org/222
Windows PowerShell Cookbookから(O'Reilly)
by Lee Holmes(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
Shay Levy

C:\Windows\system32\Windowspowershell\v1.0(およびC:\Windows\syswow64\Windowspowershell\v1.0(x64マシンの場合)Windowsエクスプローラーでダブルクリックpowershell.exe背景が黒のPowerShellが開きます。 PowerShellコンソールは、[スタート]メニューから開くと青で表示されます。これは、powershell.exeは、デフォルトのプロパティとは別に設定できます。

デフォルトのオプション、フォント、色、レイアウトを設定するには、PowerShellコンソールを開き、次を入力します。 Alt-Space、[デフォルト]メニューオプションを選択します。

ランニング start powershell cmd.exeから、デフォルト設定で新しいコンソールを開始する必要があります。

33
Rynant

色とウィンドウのサイズは、ショートカットLNKファイルによって定義されます。私はあなたが必要なことをする方法を見つけたと思う、これを試してください:

Explorer.exe "Windows PowerShell.lnk"

LNKファイルは、すべてのユーザースタートメニューにあります。このメニューは、on XPまたはWindows 7。

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Accessories\Windows PowerShell
11
Andy Arismendi