I just stumbled upon a cool PowerShell feature where you can use the drive prefix (like 'd:') to quickly jump back to the last location you accessed on that drive. For example, if I'm in 'D:/somewhere', I can just type 'd:' to go back. You can also use the built-in command to get more info about it. Anyone else use this trick?
3 Answers
I recently started using 'Push-Location' and 'Pop-Location', and I can't believe I didn't know about them sooner! Such a game changer for navigation. Thanks for sharing this tip!
That's awesome! I love discovering new tips like this. It seems to work not just in PowerShell but also in DOS, which is kind of nostalgic!
Absolutely! This has been around since at least DOS 3.0, long before PowerShell was a thing.
Haha, I feel like a kid too! There's just so much to learn!
You should also check out 'pushd' and 'popd'! They’re not strictly PowerShell commands but work great, especially if you're using aliases. Definitely worth playing with!
So you mean 'Push-Location' and 'Pop-Location'? Totally worth getting familiar with those!
I get that! But I still prefer using direct paths rather than relying on those commands, especially in scripts.