Public/Initialize-Virtualenv.ps1
Function Initialize-Virtualenv(){ <# .SYNOPSIS To enable Virtualenv on your PowerShell console .PARAMETER Path Specifies the absolute path of your Virtualenv .EXAMPLE Enable-Virtualenv Enable-Virtualenv -Path 'c:\project\env' .NOTES Version: 1.0.0 Author: Thomas ILLIET Creation Date: 22/07/2018 #> Param( [Parameter(Mandatory=$False)] [string]$Path ) Try { # Set Path if is not defined if([string]::IsNullOrEmpty($Path)){ $Path = Join-Path -Path (get-location) -ChildPath "env" } if((Test-Path $Path) -eq $False){ New-Item -ItemType directory -Path $Path | Out-Null } else { Write-Warning "Virtual Environment has already exist !" } } Catch { Write-Error "Unable to create Powershell Venv : $($_.Exception.Message)" } } |