Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PowerShell Set-WindowTitle profile config
function Set-WindowTitle { $global:WindowTitleOverride = [string]::Join(" ",$args) }
Set-Alias -name "title" -value Set-WindowTitle
function Prompt
{
# Set WindowTitle to current directory name, unless overridden with Set-WindowTitle
$host.ui.RawUI.WindowTitle = if ($global:WindowTitleOverride) { $global:WindowTitleOverride } else { get-location };
if ($GitPromptScriptBlock) { & $GitPromptScriptBlock } # posh-git compatibility
else { 'PS ' + $pwd + '> ' } # default. TODO: is it possible to chain and call the previous `Prompt` command?
}
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.