Compartilhar via


Using the Get-Location Cmdlet

Checking Your Location in a Windows PowerShell Namespace

The Get-Location cmdlet simply lets you know where you are within the various Windows PowerShell drives. For example, this command:

Get-Location

Returns information similar to this:

Path
----
C:\Documents and Settings\kenmyer

If you’d like to know the current location in a different drive, just use the -psdrive parameter following the call to Get-Location. For example, this command leaves you in your current location, but tells you where you would be if you used Set-Location to switch to the HKCU drive:

Get-Location -psdrive hkcu
Get-Location Aliases
  • gl