Skip to content

Instantly share code, notes, and snippets.

@seankearon
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seankearon/04d4f152f81f0e5f2146 to your computer and use it in GitHub Desktop.
Save seankearon/04d4f152f81f0e5f2146 to your computer and use it in GitHub Desktop.
ps: useful snippets
# Get the script's folder
function get_script_directory # http://blogs.msdn.com/b/powershell/archive/2007/06/19/get-scriptdirectory.aspx
{
$Invocation = (Get-Variable MyInvocation -Scope 1).Value
Split-Path $Invocation.MyCommand.Path
}
$scriptpath = get_script_directory
cd $scriptpath
# Pause for user to press a key
Write-Host "Press any key to continue ..."
$x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment