0.7.3 C:\Program Files\WindowsPowerShell\Modules\posh-git\0.7.35.1.17134.48 2.17.1Windows 10 | 10.0.17134.48I am experiencing a problem with...$GitPromptSettings appears to have changed as the Wiki article on customizing has some options that don't exit and I'm not able to find the proper setting:
https://github.com/dahlbyk/posh-git/wiki/Customizing-Your-PowerShell-Prompt
I'm interested in if anyone happens to know what the new setting that replaced this is now: $GitPromptSettings.DefaultPromptPrefix.ForegroundColor
I've tried $GitPromptSettings.BeforeForegroundColor = [ConsoleColor]::Cyan and that does not seem to have any effect.
I had the same issue, but noticed that the described properties are for version >1.0.0. Updating the module to the latest pre-release made them available.
Which would be what version? I'm on 0.7.3
Should be 1.0.0-beta2. See https://www.powershellgallery.com/packages/posh-git/1.0.0-beta2
@schwindelig is correct. There's an incomplete v0 section on that wiki page, but for a full list it's best to consult the v0 source: https://github.com/dahlbyk/posh-git/blob/v0.7.3.1/src/GitPrompt.ps1#L4-L119. The prompt customization experience, including adjusting colors for DefaultPromptPrefix (and basically everything), is greatly improved by upgrading to 1.0.0-beta2.
If you don't wish to upgrade to v1, you can cheat a bit to colorize DefaultPromptPrefix:
$GitPromptSettings.DefaultPromptPrefix = '$(Write-Host (1 + (Get-History -Count 1 | % Id)) -ForegroundColor Cyan -NoNewLine) '
Most helpful comment
@schwindelig is correct. There's an incomplete v0 section on that wiki page, but for a full list it's best to consult the v0 source: https://github.com/dahlbyk/posh-git/blob/v0.7.3.1/src/GitPrompt.ps1#L4-L119. The prompt customization experience, including adjusting colors for
DefaultPromptPrefix(and basically everything), is greatly improved by upgrading to1.0.0-beta2.If you don't wish to upgrade to v1, you can cheat a bit to colorize
DefaultPromptPrefix: