PSScriptRoot - Contains the full path to the script that invoked the current command. The value of this property is populated only when the caller is a script.
Насколько помню не совсем. Если просто запускаете через powershell.exe - то да. А если дебажите в ISE или VSCode, то у них у каждой свои переменные. Чуть разные.