Private/Set-Prompt.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Function Set-Prompt {
    <#
    .SYNOPSIS
        Override default Prompt to print Virtualenv Name in cmd line
    .NOTES
        Version: 1.0.0
        Author: Thomas ILLIET
        Creation Date: 21/07/2018
    #>

    write-host "PS " -NoNewline
    if($VirtualenvName) {
        Write-Host "( $VirtualenvName ) " -NoNewline -ForegroundColor Red
    }
    write-host (Get-Location) -NoNewline
    write-host ">" -NoNewline
    return " "
}