私の PowerShell プロファイルは、プロンプトと背景色をカスタマイズします。
$Host.UI.RawUI.BackgroundColor = 'Red';
function prompt
{
Write-Host ("PS >") -nonewline -foregroundcolor Magenta
return " "
}
PowerShell を開くと、両方のカスタマイズが機能します。
PS >
Git Shell を開くと、背景色のカスタマイズしか機能しません。背景は赤ですが、プロンプトは短くありません。
C:\Users\BigFont\Documents\GitHub>
...そして. $profile
、プロファイルを明示的にインポートするために実行すると、カスタマイズ全体が機能します。
PS >
プロファイルを明示的にインポートせずに、Git Shell でプロンプトを変更するにはどうすればよいですか?
編集
#1
実行$profile | select *
結果
AllUsersAllHosts : C:\Windows\SysWOW64\WindowsPowerShell\v1.0\profile.ps1
AllUsersCurrentHost : C:\Windows\SysWOW64\WindowsPowerShell\v1.0\Microsoft.PowerShell_profile.ps1
CurrentUserAllHosts : C:\Users\BigFont\Documents\WindowsPowerShell\profile.ps1
CurrentUserCurrentHost : C:\Users\BigFont\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
#2
実行 . $profile
すると、Posh Git プロファイルがオーバーライドされます。これが私が望んでいることです - 今私は実行する必要なしにそれを行う方法を決定する必要があります . $profile
.