Skip to content

Instantly share code, notes, and snippets.

@jaymcgrath
Created January 5, 2017 22:02
Show Gist options
  • Save jaymcgrath/c7fe25e7d307b47ec7fa3def0555b10a to your computer and use it in GitHub Desktop.
Save jaymcgrath/c7fe25e7d307b47ec7fa3def0555b10a to your computer and use it in GitHub Desktop.
Microsoft powershell aliases for easily switching between virtualenvs
$path_to_my_envs = "CHANGE ME" # <-- Change this to the windows system path to your virtualenvs. Mine is "C:\users\jaymcgrath\git\envs\"
# Each env should be named in the format "llama_env"
# For example, issuing the command "env llama" would activate the virtualenv at $path_to_my_envs + "llama_env"
function Activate-Env {
$envname = $args[0]
$commandstr = $path_to_my_envs + $envname + "_env\scripts\activate.ps1"
& $commandstr
}
New-Alias -Name env -Value Activate-Env
################ Some other handy git aliases ####################
# Alias gs as git status for current dir
function Get-GitStatus { & git status $args }
New-Alias -Name gs -Value Get-GitStatus
# Alias ga as git add for current dir
function Set-GitAdd { & git add $args }
New-Alias -Name ga -Value Set-GitAdd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment