Skip to content

Instantly share code, notes, and snippets.

View gimmi's full-sized avatar

Gian Marco Gherardi gimmi

View GitHub Profile
@jpoehls
jpoehls / exec.ps1
Created May 31, 2012 14:25
PowerShell Exec function from psake
# Taken from psake https://github.com/psake/psake
<#
.SYNOPSIS
This is a helper function that runs a scriptblock and checks the PS variable $lastexitcode
to see if an error occcured. If an error is detected then an exception is thrown.
This function allows you to run command-line programs without having to
explicitly check the $lastexitcode variable.
.EXAMPLE