Finding Current Script Path

Ever wanted to locate the path of your current PowerShell script? This can be useful to call other scripts or resources in the same folder.

To determine the folder your current PowerShell script is located in, try this:

Split-Path -parent $MyInvocation.MyCommand.Definition

Posted Mar 26 2009, 08:00 AM by ps1
Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.