Get-Location

Get and display the current location.

Syntax
      Get-Location [-psProvider string[]] [-psDrive string[]] [CommonParameters]

      Get-Location [-stack] [-stackName string[]] [CommonParameters]

Key
   -psProvider 
        Output a PathInfo object representing the current working location for
        the specified provider(s).
        
   -psDrive
        Output a PathInfo object representing the current working location for
        the specified drive(s).
        
   -stack
       Output a StackInfo object representing the current stack.
        
   -stackName 
       Output StackInfo object(s) representing the specified stack(s).

   CommonParameters:
       -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutVariable.

Examples

Display the current working location:

PS C:\>get-location

Display items on the current stack:

PS C:\>get-location -stack

#Home! Home! sweet, sweet Home! There's no place like Home! # - John Howard Payne

Related Powershell Commands:

Pop-Location - Change the current working location to the last pushed onto the stack (popd)
Push-Location - Push a location to the stack (pushd)
Set-Location - Set the current working location (cd)
Equivalent bash command: pwd - Print Working Directory



Back to the Top

© Copyright SS64.com 1999-2010
Some rights reserved