PathIntrinsics.SetLocation(String) PathIntrinsics.SetLocation(String) PathIntrinsics.SetLocation(String) Method

Definition

Changes the current location to the specified path.

public System.Management.Automation.PathInfo SetLocation (string path);
member this.SetLocation : string -> System.Management.Automation.PathInfo
Public Function SetLocation (path As String) As PathInfo
Parameters
path
String String String

The path to change the location to. This can be either a drive-relative or provider-relative path. It cannot be a provider-internal path.

Returns

The path of the new current location.

Exceptions

If path does not exist, is not a container, or resolved to multiple containers.

If path refers to a provider that does not exist.

If path refers to a drive that does not exist.

If the provider associated with path threw an exception.

Applies to