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.

C++
public:
 bool Exists(System::String ^ path);

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

PowerShell SDK 7.4.0 и друге верзије
Производ Верзије
PowerShell SDK 7.2.0, 7.3.0, 7.4.0
Windows PowerShell 5.1.0.0

Exists(String, Boolean, Boolean)

Determines if an item at the given path exits.

C++
public:
 bool Exists(System::String ^ path, bool force, bool literalPath);

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

PowerShell SDK 7.4.0 и друге верзије
Производ Верзије
PowerShell SDK 7.2.0, 7.3.0, 7.4.0
Windows PowerShell 5.1.0.0