Collapse the table of content
Expand the table of content
Expand Minimize
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

PathIntrinsics.SetLocation Method

Changes the current location to a new location using the specified path.

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

Dim instance As PathIntrinsics
Dim path As String
Dim returnValue As PathInfo

returnValue = instance.SetLocation(path)

public PathInfo SetLocation (
	string path
public PathInfo SetLocation (
	String path
public function SetLocation (
	path : String
) : PathInfo



The path to the new location.

Return Value

A PathInfo object that represents the new location.

Exception typeCondition

The path parameter is null.


The path parameter refers to a path that does not exist, is not a container, or can be resolved to multiple containers.


The path parameter refers to a provider that does not exist.


The path parameter refers to a drive that does not exist.


The referenced provider throws an exception.

The path parameter can be set to either a drive-relative or provider-relative path. However, it cannot be set to a provider-internal path.

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