How to Navigate to a Folder in PowerShell

PowerShell is a versatile command-line shell and scripting language from Microsoft, which can improve productivity and efficiency by automating repetitive tasks.

An essential skill when working with PowerShell is knowing how to navigate between different folders in the system. In this tutorial, we will guide you on how to navigate to a folder in PowerShell.

Step 1: Opening PowerShell

To begin, you need to open PowerShell. Press Win + X and from the list that appears, select Windows PowerShell (Admin). Doing so will open PowerShell with administrator permissions. It is crucial to run PowerShell as an administrator because some commands require elevated permissions.

Step 2: Understanding the Basic Command

The basic command used to navigate to a folder in Powershell is Set-Location. This command is typically abbreviated as cd (Change Directory) – a familiar command from the old DOS days and is still used in the Command Prompt too.

Step 3: Using Set-Location to Navigate to a Folder

To navigate to a folder, type Set-Location or cd followed by the path of the directory. For instance, if you want to navigate to a folder named ‘Documents’ on your ‘C:’ drive, you would type:

or

After pressing Enter, you will be navigated to the ‘Documents’ folder.

Step 4: Moving Up a Directory

To move up one folder level, simply type cd .. and press Enter. Each additional .. will take you up another level.

Conclusion

By mastering these simple commands, you can quickly and efficiently navigate to any directory in your PowerShell session. As you continue to develop your PowerShell skills, these steps will become second nature.