Christopher Tyler

How to Create PowerShell Alias

Create an alias called “ve” that looks for the relative location of -Value and runs it.

1
> New-Alias -Name ve -Value venv/scripts/activate.ps1

Export the alias to a script.

1
> Export-Alias -Name ve -Path "venv.ps1" -As Script

Make sure this scripts runs each time you start a powershell session.

1
> Add-Content -Path $Profile -Value (Get-Content venv.ps1)

<< Previous Post

|

Next Post >>

#Powershell #Python #Venv