Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Overwrite of powershell promt which works with gitposh and provides last argument and last command varibales
function global:prompt {
$global:l = "$($(Get-History)[-1])"
$temp = "$($(Get-History)[-1])" -split " "
$global:lc = $temp[0]
$global:lp = $temp[1..($temp.length-1)]
# Reset color, which can be messed up by Enable-GitColors
$Host.UI.RawUI.ForegroundColor = $GitPromptSettings.DefaultForegroundColor
Write-Host($(Split-Path $pwd -Leaf)) -nonewline -foregroundcolor Blue
return " $ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.