My PowerShell profile customizes the prompt and background color.
$Host.UI.RawUI.BackgroundColor = 'Red';
function prompt
{
Write-Host ("PS >") -nonewline -foregroundcolor Magenta
return " "
}
When I open PowerShell, both customizations work:
PS >
When I open Git Shell, only the background color customization works The background is red, but the prompt isn't short.
C:\Users\BigFont\Documents\GitHub>
...and then, if I run . $profile
to explicitly import my profile, the entire customization does work.
PS >
How can I make Git Shell change the prompt without having to explicitly import my profile?
Edits
# 1
Running $profile | select *
results in
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
Running . $profile
does override Posh Gits profile. This is what I want - now I need to determine how to do it without needing to run . $profile
.