Hey, did you know about the drive prefix trick to jump back to your last location?

0
0
Asked By CuriousCat82 On

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

Answered By CommandLineNinja On

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!

ScriptingSavant -

I get that! But I still prefer using direct paths rather than relying on those commands, especially in scripts.

Answered By TechieGuru77 On

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!

OldSchoolTech94 -

Absolutely! This has been around since at least DOS 3.0, long before PowerShell was a thing.

GamerDude123 -

Haha, I feel like a kid too! There's just so much to learn!

Answered By PowerShellFan08 On

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!

CodingNerd34 -

So you mean 'Push-Location' and 'Pop-Location'? Totally worth getting familiar with those!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.