It is recommended to have the following command somewhere in the beginning of the powershell script file:

cd /d $PSScriptRoot

The presence of this will run all the commands after it with respect to the location of the running powershell script file.