I've written a cmdlet that converts binary records off the trace log into well behaved PSObjects and am having a puzzling input problem. I'd like to allow the user to just put in the file name and have the cmdlet find the file. So the format would be
Get-ETL filename.etl ...
This fails if filename.etl isn't in the root directory. Makes sense, psychic cmdlets aren't part of the current release.
So, as a first approximation, I decided to try picking up the current directory and appending it to the file name by running Get-Location in a runspace. Runs fine, but returns the wrong path. Instead of returning the directory where the cmdlet is running (c:\psd) it returns my home directory (c:\documents and settings\jmcgill). Huh? Anybody got a clue what's going on?
As an alternative, is there some local variable, analogous to $Env, that contains the current directory?