$pwd and Directory.CurrentWorkingDirectory
PS: C:\Users\Rene\AppData\Local\Temp> $pwd
Path
----
C:\Users\Rene\AppData\Local\Temp
PS: C:\Users\Rene\AppData\Local\Temp> [System.IO.Directory]::GetCurrentDirectory()
C:\Users\Rene
The reasons are
- PowerShell has a notion of working directories in various providers, not only file systems
- A PowerShell process can have multiple runspaces, each with a different file system location. Thus, it is not even possible to align the current directory of a PowerShell process with the «current location» of the run spaces.