SyntaxFix
Write A Post
Hire A Developer
Questions
Try the following
$path = $MyInvocation.MyCommand.Definition
This may not give you the actual path typed in but it will give you a valid path to the file.