Create a gist now

Instantly share code, notes, and snippets.

VSH + NP + git PowerShell
# Load posh-git profile
. 'C:\Projects\Tools\posh-git\profile.example.ps1'
function vsh() {
Write-Output "Opening first solution..."
$sln = (dir -in *.sln -r | Select -first 1)
Write-Output "Found $($sln.FullName)"
Invoke-Item $sln.FullName
}
function title($str) {
(get-host).ui.rawui.windowtitle = $str
}
function ga() {
Write-Output "Staging all changes..."
git add -A
git status
}
function gco() {
param([switch]$amend, [switch]$a)
$argstr = $args -join ' '
$message = '"', $argstr, '"' -join ''
if ($amend -or $a) {
Write-Output "Amending previous commit with message: $message"
git commit -m $message --amend
} else {
Write-Output "Committing with message: $args"
git commit -m $message
}
}
function gca() {
$argstr = $args -join ' '
$message = '"', $argstr, '"' -join ''
Write-Output "Amending previous commit with message: $message"
git commit -m $message --amend
}
set-alias -name np -value "C:\Program Files\Sublime Text 2\sublime_text.exe"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment