Skip to content

Instantly share code, notes, and snippets.

@hasparus
Created March 18, 2018 18:44
Show Gist options
  • Save hasparus/5b16718e158123b51090193c6bb41a06 to your computer and use it in GitHub Desktop.
Save hasparus/5b16718e158123b51090193c6bb41a06 to your computer and use it in GitHub Desktop.
#requires -Version 2 -Modules posh-git
#based on tehrob from oh-my-posh
function Write-Theme
{
param(
[bool]
$lastCommandFailed,
[string]
$with
)
$prompt = ' ';
$prompt += Write-Prompt -Object "$(Get-FullPath -dir $pwd) " -ForegroundColor $s1.Colors.DriveForegroundColor
$status = Get-VCSStatus
if ($status)
{
$gitinfo = get-vcsinfo -status $status
$prompt += Write-Prompt -Object "$($gitinfo.vcinfo) " -ForegroundColor $([ConsoleColor]::Yellow)
}
$prompt += Write-Prompt -Object $s1.PromptSymbols.PromptIndicator -ForegroundColor $s1.Colors.AdminIconForegroundColor
}
$s1 = $global:ThemeSettings
$s1.GitSymbols.BranchIdenticalStatusToSymbol = "="
$s1.GitSymbols.BranchSymbol = [char]::ConvertFromUtf32(0xe0a0)
$s1.GitSymbols.BranchUntrackedSymbol = "*"
$s1.PromptSymbols.PromptIndicator = "`n`r~>"
# Colors
$s1.Colors.PromptForegroundColor = [ConsoleColor]::White
$s1.Colors.AdminIconForegroundColor = [ConsoleColor]::Cyan
$s1.Colors.DriveForegroundColor = [ConsoleColor]::Green
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment