Export (0) Print
Expand All

PathIntrinsics.PopLocation Method

Pops off the top location from the specified location stack or the default location stack.

Namespace: System.Management.Automation
Assembly: System.Management.Automation (in System.Management.Automation.dll)

Dim instance As PathIntrinsics
Dim stackName As String
Dim returnValue As PathInfo

returnValue = instance.PopLocation(stackName)

public PathInfo PopLocation (
	string stackName
public PathInfo PopLocation (
	String stackName
public function PopLocation (
	stackName : String
) : PathInfo



The name (identifier) of the specified location stack. If null, the default location stack is used.

Return Value

A PathInfo object that represents the location (the latest location) that was at the top of the location stack.

Exception typeCondition

The path on the stack does not exist, is not a container, or can be resolved to multiple containers. This exception type is thrown when the stack name contains wildcard characters that resolve to multiple location stacks or when the stack cannot be found.


The provider that is associated with the retrieved path does not exist.


The drive that is associated with the retrieved path does not exist.


The provider that is associated with the retrieved path throws an exception.

If no stack name is specified, the last location is popped off the default location stack. To set the default location stack, see the SetDefaultLocationStack method.

To add the current location to the location stack, see the PushCurrentLocation method.

To retrieve the complete location stack, see the LocationStack method.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


Target Platforms

© 2015 Microsoft