I’m converting a dos batch script for a critical process that runs periodically. There’s a “source path” variable with “%~dp0” which I understand means the root of script directory. Powershell has an equivalent variable - $PSScriptRoot.
So, how do you “echo” what the $PSScriptRoot path is? In the dos batch script, there are pauses to validate the path before proceeding to the next set of commands.
Doing a write-host “This is the current script path: $PSScriptRoot” does not work.