PSDriveInfo PSDriveInfo PSDriveInfo Class

Definition

Defines a drive that exposes a provider path to the user.

public class PSDriveInfo : IComparable
type PSDriveInfo = class
    interface IComparable
Public Class PSDriveInfo
Implements IComparable
Inheritance
PSDriveInfoPSDriveInfoPSDriveInfo
Implements

Remarks

A cmdlet provider may want to derive from this class to provide their own public members or to cache information related to the drive. For instance, if a drive is a connection to a remote machine and making that connection is expensive, then the provider may want keep a handle to the connection as a member of their derived PSDriveInfo class and use it when the provider is invoked.

Constructors

PSDriveInfo(PSDriveInfo) PSDriveInfo(PSDriveInfo) PSDriveInfo(PSDriveInfo)

Constructs a new instance of the PSDriveInfo using another PSDriveInfo as a template.

PSDriveInfo(String, ProviderInfo, String, String, PSCredential) PSDriveInfo(String, ProviderInfo, String, String, PSCredential) PSDriveInfo(String, ProviderInfo, String, String, PSCredential)

Constructs a drive that maps an MSH Path in the shell to a Cmdlet Provider.

PSDriveInfo(String, ProviderInfo, String, String, PSCredential, Boolean) PSDriveInfo(String, ProviderInfo, String, String, PSCredential, Boolean) PSDriveInfo(String, ProviderInfo, String, String, PSCredential, Boolean)

Constructs a drive that maps an MSH Path in the shell to a Cmdlet Provider.

PSDriveInfo(String, ProviderInfo, String, String, PSCredential, String) PSDriveInfo(String, ProviderInfo, String, String, PSCredential, String) PSDriveInfo(String, ProviderInfo, String, String, PSCredential, String)

Constructs a drive that maps an MSH Path in the shell to a Cmdlet Provider.

Properties

Credential Credential Credential

Gets the credential to use with the drive.

CurrentLocation CurrentLocation CurrentLocation

Gets or sets the current working directory for the drive.

Description Description Description

Gets or sets the description for the drive.

DisplayRoot DisplayRoot DisplayRoot

Gets or sets the UNC path of the drive. This property would be populated only if the created PSDrive is targeting a network drive or else this property would be null.

MaximumSize MaximumSize MaximumSize

When supported by provider this specifies a maximum drive size.

Name Name Name

Gets the name of the drive

Provider Provider Provider

Gets the name of the provider that root path of the drive represents.

Root Root Root

Gets the root path of the drive.

VolumeSeparatedByColon VolumeSeparatedByColon VolumeSeparatedByColon

Methods

CompareTo(PSDriveInfo) CompareTo(PSDriveInfo) CompareTo(PSDriveInfo)

Compares this instance to the specified drive.

CompareTo(Object) CompareTo(Object) CompareTo(Object)

Compares this instance to the specified object. The object must be a PSDriveInfo.

Equals(Object) Equals(Object) Equals(Object)

Compares this instance to the specified object.

Equals(PSDriveInfo) Equals(PSDriveInfo) Equals(PSDriveInfo)

Compares this instance to the specified object.

GetHashCode() GetHashCode() GetHashCode()

Gets the hash code for this instance.

ToString() ToString() ToString()

Gets the name of the drive as a string.

Operators

Equality(PSDriveInfo, PSDriveInfo) Equality(PSDriveInfo, PSDriveInfo) Equality(PSDriveInfo, PSDriveInfo)

Equality operator for the drive determines if the drives are equal by having the same name.

GreaterThan(PSDriveInfo, PSDriveInfo) GreaterThan(PSDriveInfo, PSDriveInfo) GreaterThan(PSDriveInfo, PSDriveInfo)

Compares the specified drives to determine if drive1 is greater than drive2.

Inequality(PSDriveInfo, PSDriveInfo) Inequality(PSDriveInfo, PSDriveInfo) Inequality(PSDriveInfo, PSDriveInfo)

Inequality operator for the drive determines if the drives are not equal by using the drive name.

LessThan(PSDriveInfo, PSDriveInfo) LessThan(PSDriveInfo, PSDriveInfo) LessThan(PSDriveInfo, PSDriveInfo)

Compares the specified drives to determine if drive1 is less than drive2.

Applies to