This question asks about how to get the directory name of a path in a batch script.
How does one do the equivalent of POSIX dirname in PowerShell?