#PSTip Use Push-Location to save your current location

Going through folders, you sometimes find yourself in some strangely named ones you are sure you’ll have to revisit again. To avoid searching for the folders after some digging around,  use the pushd (Push-Location) command to save your current location to stack.

PS C:\Windows\System32\DriverStore\FileRepository\brmfcmdm.inf_x86_neutral_3b38c2e8e6f06c1b> pushd

Or to save the location and go one folder up in the folder structure do:

PS C:\Windows\System32\DriverStore\FileRepository\brmfcmdm.inf_x86_neutral_3b38c2e8e6f06c1b> pushd ..

Now you can dig around how you want. For example go check the driver setup logs in the inf folder. After you are finished, use popd (Pop-Location) to go back to where you were.

PS C:\windows\inf> popd
PS C:\Windows\System32\DriverStore\FileRepository\brmfcmdm.inf_x86_neutral_3b38c2e8e6f06c1b>

About the author: Jakub Jareš

Jakub Jareš is an IT professional with strong background in Windows desktop systems. He started with Powershell a few months ago, and couldn't let go ever since. Showing that with the right attitude, a bit of effort and lot of practice you can become advanced in Powershell in no time.

Related Posts

%d bloggers like this: