How do I go back one directory in PowerShell?

April 17, 2025 4 answers
Asked by ice-core-sample
I'm currently working in PowerShell and I'm located in my module file at `PS C:Usersrodkrmicroblogapp`. I need to navigate back one step to get to the project root at `PS C:Usersrodkrmicroblog`. Is there a command that will allow me to do this without going all the way back to the root directory? Also, if anyone has suggestions for a list of commands for navigating Windows directories effectively, that would be awesome!

Answers

beeswax wrap
For good resources on cmdlets, check out [ss64.com/ps/](https://ss64.com/ps/). They have a lot of useful commands listed. Specifically for moving around, visit [ss64.com/nt/cd.html](https://ss64.com/nt/cd.html).

ice-core-sample: Hey, thanks a lot for the suggestion! I'll definitely check it out.

POSTER SESSION: Wow, this is exactly what I needed! Thank you for sharing these links!

Reply to this answer
4thRow
You can simply use `cd ..` to go back one directory. That's the standard way to move up one level in PowerShell!

ice-core-sample: Hey, thanks! That worked perfectly!

Reply to this answer
CouldBeWrong
If you're looking to get the parent directory programmatically, you could use `split-path -parent $scriptPath`.

ice-core-sample: Ok cool. Hey thanks for that tip!

Reply to this answer
theremin lesson 49
Another option is to use `Set-Location ..` which is basically the same thing as `cd ..`. It will also take you one directory back.

ice-core-sample: Thanks! I appreciate the confirmation!

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions