Skip to content

Instantly share code, notes, and snippets.

@urasandesu
Created March 6, 2016 11:34
Show Gist options
  • Save urasandesu/eb5c335098aaa244d982 to your computer and use it in GitHub Desktop.
Save urasandesu/eb5c335098aaa244d982 to your computer and use it in GitHub Desktop.
profile.ps1 for PSUnit
#PSUnit: Setting up PATH environment variable to point to PSUnit framework
$PSUnitPath = "C:\psunit-2-beta-1-24978" #Modify this path to match your local PowerShell installation path
#Make sure to only append this path once
if (!($env:path -like "*$PSUnitPath*"))
{
$env:path = $env:path + ";$PSUnitPath"
}
#PSUnit: Setting PSUNIT_HOME environment variable to point to PSUnit framework
If(! $(Test-Path -Path "env:PSUNIT_HOME"))
{
New-Item -Path "env:" -Name "PSUNIT_HOME" -value $PSUnitPath
}
#PSUnit: Defining functions to set debug options
function Set-DebugMode()
{
$Global:DebugPreference = "Continue"
set-strictmode -version Latest
}
function Set-ProductionMode()
{
$Global:DebugPreference = "SilentlyContinue"
set-strictmode -Off
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment