I've found that doing it this way doesn't always work properly (I forget the exact circumstances for when it fails, but it might be when you execute the script from a directory other than the one it's stored in -- i.e. `./foo.ps1` vs `./bar/foo.ps1`

There's a way that I've found that's more reliable.  This is one thing I miss from other languages -- no real equiv to `__FILE__`

```powershell
function Get-CurrentDirectory
{
  $thisName = $MyInvocation.MyCommand.Name
  [IO.Path]::GetDirectoryName((Get-Content function:$thisName).File)
}
```