tags:

views:

273

answers:

1

How do I do this in PowerShell. In a batch file I would do: %~d0%~p0

+2  A: 

From Get-ScriptDirectory to the Rescue blog entry ...

function Get-ScriptDirectory
{
  $Invocation = (Get-Variable MyInvocation -Scope 1).Value
  Split-Path $Invocation.MyCommand.Path
}
JP Alioto