ItemCmdletProviderIntrinsics.Exists Method

Definition

Overloads

Exists(String)

Determines if an item at the given path exits.

Exists(String, Boolean, Boolean)

Determines if an item at the given path exits.

Exists(String)

Determines if an item at the given path exits.

public:
 bool Exists(System::String ^ path);
public:
 bool Exists(Platform::String ^ path);
bool Exists(std::wstring const & path);
public bool Exists (string path);
member this.Exists : string -> bool
Public Function Exists (path As String) As Boolean

Parameters

path
String

The path to the item to determine if it exists. It may be a drive or provider-qualified path and may include glob characters.

Returns

True if the item at the specified path exists. False otherwise.

Exceptions

If path is null.

If the path refers to a provider that could not be found.

If the path refers to a drive that could not be found.

If the provider that the path refers to does not support this operation.

If the provider threw an exception.

Applies to

Exists(String, Boolean, Boolean)

Determines if an item at the given path exits.

public:
 bool Exists(System::String ^ path, bool force, bool literalPath);
public:
 bool Exists(Platform::String ^ path, bool force, bool literalPath);
bool Exists(std::wstring const & path, bool force, bool literalPath);
public bool Exists (string path, bool force, bool literalPath);
member this.Exists : string * bool * bool -> bool
Public Function Exists (path As String, force As Boolean, literalPath As Boolean) As Boolean

Parameters

path
String

The path to the item to determine if it exists. It may be a drive or provider-qualified path and may include glob characters.

force
Boolean

Passed on to providers to force operations.

literalPath
Boolean

If true, globbing is not done on paths.

Returns

True if the item at the specified path exists. False otherwise.

Exceptions

If path is null.

If the path refers to a provider that could not be found.

If the path refers to a drive that could not be found.

If the provider that the path refers to does not support this operation.

If the provider threw an exception.

Applies to