Last active
August 29, 2015 14:03
-
-
Save seankearon/04d4f152f81f0e5f2146 to your computer and use it in GitHub Desktop.
ps: useful snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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