Public/Disable-Virtualenv.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Function Disable-Virtualenv {
    <#
    .SYNOPSIS
        To Disable Virtualenv on your PowerShell console
    .EXAMPLE
        Disable-Virtualenv
    .NOTES
        Version: 1.0.0
        Author: Thomas ILLIET
        Creation Date: 22/07/2018
    #>

    if($VirtualenvFolder) {
        # Remove Variable to unset VirtualEnv
        Remove-Variable -Scope 'Script' -Name 'VirtualenvFolder'
        Remove-Variable -Scope 'Script' -Name 'VirtualenvName'
    } else {
        Write-Error "Can not disable Virtualenv because it is not enabled."
    }
}