Demo.ps1
# dull prompt ipmo Powerline; Set-PowerlinePrompt $function:prompt # That's a little prettier ... pushd .\Documents\WindowsPowerShell\ # Oh, I want to see the location stack size Get-Location -Stack if($pushd = (Get-Location -Stack).count) { "?" + $pushd } # That'll work ... let's try putting that in our prompt using module PowerLine $PushLine = [PowerLineBlock]@{ bg = "cyan"; fg = "white" text = { if($pushd = (Get-Location -Stack).count) { "»" + $pushd } } } $PushLine "$PushLine" # Perfect, now let's insert that ... $PowerLinePrompt $PowerLinePrompt.Lines $PowerLinePrompt.Lines[0].Blocks $PowerLinePrompt.Lines[0].Blocks.Insert(2,$PushLine) # Tada!!! popd # Now let's see about adding the elapsed time on the right side $PromptLine = [PowerLine]::New(@( [PowerLineBlock]::Column # This is the column break, the rest is right-aligned [PowerLineBlock]@{ bg = "DarkGray"; fg = "white"; text = { Get-Elapsed } } ) ) "$PromptLine" # Looks good, we'll stick it in as the first line $PowerLinePrompt.Lines.Insert(0, $PromptLine) # And to make it overlap the previous output, set the count of "PrefixLines" $PowerLinePrompt.PrefixLines = 1 |