Pop-Location - PowerShell

Changes the current location to the location most recently pushed onto the stack. You can pop the location from the default stack or from a stack that you create by using the Push-Location cmdlet. (Pop-Location)

# NAMEPop-Location

# SYNOPSIS
Changes the current location to the location most recently pushed onto the stack. You can pop the location from the default stack or from a stack that you create by using the Push-Location cmdlet.

# DESCRIPTION
The Pop-Location cmdlet changes the current location to the location most recently pushed onto the stack by using the Push-Location cmdlet. You can pop a location from the default stack or from a stack that you create by using a Push-Location command.

# PARAMETERS -PassThru[<SwitchParameter>]
Passes an object representing the location to the pipeline. By default, this cmdlet does not generate any output.

# OUTPUTS
None or System.Management.Automation.PathInfo
When you use the PassThru parameter, Pop-Location generates a System.Management.Automation.PathInfo object that represents the location. Otherwise, this cmdlet does not generate any output.

# NOTES

You can also refer to Pop-Location by its built-in alias, "popd". For more information, see about_Aliases.

The Pop-Location cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, type "Get-PSProvider". For more information, see about_Providers.

# EXAMPLE 1

C:\PS>pop-location

# Description
-----------
This command changes your location to the location most recently added to the current stack.

# EXAMPLE 2

C:\PS>pop-location -stackname Stack2

# Description
-----------
This command changes your location to the location most recently added to the Stack2 stack.

# Description
-----------
These commands use the Push-Location and Pop-Location cmdlets to move between locations supported by different Windows PowerShell providers. The commands use the "pushd" alias for Push-Location and the "popd" alias for Pop-Location.

The first command pushes the current file system location onto the stack and moves to the HKLM drive supported by the Windows PowerShell Registry provider. The second command pushes the registry location onto the stack and moves to a location supported by the Windows PowerShell certificate provider.

The last two commands pop those locations off the stack. The first "popd" command returns to the Registry: drive, and the second command returns to the file system drive.

PowerShell: Changes the current location to the location most recently pushed onto the stack. You can pop the location from the default stack or from a stack that you create by using the Push-Location cmdlet.