Share via


DriveCmdletProvider.RemoveDrive(PSDriveInfo) Method

Definition

Gives the provider an opportunity to clean up any provider specific data for the drive that is going to be removed.

protected:
 virtual System::Management::Automation::PSDriveInfo ^ RemoveDrive(System::Management::Automation::PSDriveInfo ^ drive);
protected virtual System.Management.Automation.PSDriveInfo RemoveDrive (System.Management.Automation.PSDriveInfo drive);
abstract member RemoveDrive : System.Management.Automation.PSDriveInfo -> System.Management.Automation.PSDriveInfo
override this.RemoveDrive : System.Management.Automation.PSDriveInfo -> System.Management.Automation.PSDriveInfo
Protected Overridable Function RemoveDrive (drive As PSDriveInfo) As PSDriveInfo

Parameters

drive
PSDriveInfo

The Drive object the represents the mounted drive.

Returns

If the drive can be removed it should return the drive that was passed in. If the drive cannot be removed, null should be returned or an exception should be thrown.

The default implementation returns the drive that was passed.

Remarks

A provider should override this method to free any resources that may be associated with the drive being removed.

Applies to