What is the difference between “.” and [System.ENVIRONMENT]::CurrentDirectory in powershell?

Question:

Answer:

[System.Environment]::CurrentDirectory returns the working directory of the PowerShell process. To get the working directory of the console session use the Get-Location cmdlet (or pwd, $pwd).

Note that this “working directory” could also be a location in the registry or any of a number of other location providers.

Source:

What is the difference between “.” and [System.ENVIRONMENT]::CurrentDirectory in powershell? by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply