The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DriveCmdletProvider::RemoveDrive Method (PSDriveInfo^)


Updated: April 27, 2016

Applies To: Windows PowerShell

Removes a Windows PowerShell drive. Implementing this method gives the provider an opportunity to clean up any provider-specific data for the drive that is going to be removed.

Namespace:   System.Management.Automation.Provider
Assembly:  System.Management.Automation (in System.Management.Automation.dll)

virtual PSDriveInfo^ RemoveDrive(
	PSDriveInfo^ drive


Type: System.Management.Automation::PSDriveInfo^

A PSDriveInfo object that represents the mounted drive to be removed.

Return Value

Type: System.Management.Automation::PSDriveInfo^

If the drive can be removed, it should return the PSDriveInfo object 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.

For more information about providers, see Windows PowerShell Providers [ps].

Return to top

Community Additions