Powershell offers multiple ways and cmdlets to find the current directory path. It is akin to getting the command output of the pwd command in Unix. We will look at some simple ways by which you can find the current directory in Powershell.
It may be pertinent to mention that findind the current directory path is different than finding the directory from which a Powershell script may be getting executed. If you are looking to find the Powershell script directory, there is a separate process.
Finding the current working directory path is similar to winding the present working directory in Unix. Powershell offers multiple ways to use the cmdlets and fetch the current directory path as discussed below.
Find the current directory path using $pwd
$pwd remains the best cmdlet that can be used in Powershell to find the current working directory in Powershell. When you specify the command in the Powershell session, you will get the current working path as displayed in the screenshot below.
You could also use the ($pwd).path command to get a similar result. The command output for both these commands is displayed below.

So, the two commands that list the current working directory in Powershell are:
$pwd
($pwd).path
Both these commands will give you the current working directory for the console session. If you wish to find the current working directory of the Powershell process, there are separate commands for that. We have shared the commands for finding the current working directory of the Powershell process in this document.
Find the current working directory using Get-Location cmdlet
The Get-Location cmdlet is an in-built cmdlet that can be used to find the current working directory in Powershell. The command output will display the path on the screen.
The screenshot below shows the cmdlet and the subsequent command output on the screen.

Besides $pwd, the Get-Location cmdlet is a basic command to fetch the current working directory of the console session. It will not share the current working directory path of the Powershell process.
Get-Location
You could store the current working directory in a variable and use it for one of your scripts or programs as well.
Finding the current working directory of the Powershell process using System.Environment
If you have a requirement to find the current working directory of the Powershell process, we can use the System.Environment class to get this information. The exact command to find the current working directory of the Powershell process is given below:
[System.Environment]::CurrentDirectory
The output of this command is displayed in the screenshot below. You can see that the command output lists the directory from which the Powershell process is being run.

The command output clearly confirms that Powershell process is being executed from the C:\Windows\System32 system directory.
Find the current working directory of Powershell using System.IO.Path
We can also use one of the in-built classes to find the current working directory of the Powershell process. System.IO.Path is the class that we will make use of as per the command line below.
[System.IO.PATH]::GetFullPath(“.”)
The command output for this command is shared in the screenshot below. It shows the current working directory of the Powershell process.

This command output is similar to the command output of the System.Environment class. You could use either of these command directives on the Powershell command prompt to find the current working directory of the Powershell process.
Summary
In this Powershell tutorial, we have seen four different commands to find the current working directory of the console session and the current working directory of the console session.
Suggested Powershell Tutorials
The following Powershell tutorials will help you in performing basic system administration tasks on a Windows computer. These directives will help in doing the administration tasks more efficiently and in a time saving way.
- How to enable Remote Desktop using Powershell?
- Get CPU temperature using Powershell
- Get all hotfixes installed by date in Powershell
- How to find stopped services using Powershell?
- How to find running services in Powershell?
- How do I check if a directory exists in Powershell?
- How to get the first few lines of a file using Powershell?
- How to find the properties of an event log in Powershell?
- How to get event logs for an event using Powershell?
- How to export event logs to CSV file using Powershell?
Rajesh Dhawan is a technology professional who loves to blog about smart wearables, Cloud computing and Microsoft technologies. He loves to break complex problems into manageable chunks of meaningful information.