I have two drives on the computer I am currently working: c: and d:. When I switch between these cd c:, cd d:, PowerShell remembers the location of the last path I was in the respective drive. I believe this path should be accessible by the value of currentLocation of the object returned by get-psDrive. However, it turns out, currentLocation is empty for the d: drive (although the path is remembered) when I cd into d: again:
PS C:\> cd C:\Users\Rene\
PS C:\Users\Rene> d:
PS D:\> cd .\bla\
PS D:\bla> get-psDrive -psProvider fileSystem | select-object name, currentLocation
Name CurrentLocation
---- ---------------
C Users\Rene
D
I assume that this discrepancy is because the d: drive is an external USB drive. If this is the case, I'd like to know if this is by design and how I can get the current path for the d: drive.