DriveCmdletProvider.RemoveDrive Method

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)
'Usage
Dim drive As PSDriveInfo
Dim returnValue As PSDriveInfo

returnValue = Me.RemoveDrive(drive)
protected virtual PSDriveInfo RemoveDrive (
	PSDriveInfo drive
)
protected PSDriveInfo RemoveDrive (
	PSDriveInfo drive
)
protected function RemoveDrive (
	drive : PSDriveInfo
) : PSDriveInfo

Parameters

drive

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

Return Value

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.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

 

Target Platforms

Windows 98, Windows 2000, Windows 2000 Server, Windows CE, Windows Server 2008, Windows 98 Second Edition, Pocket PC, Smart Phone, Windows Server 2003, Windows XP Professional, Windows Vista, Windows Server 2003 R2, Windows XP, Windows 7, Windows 2008 R2, Windows Developer Preview, Windows Server Developer Preview

Send comments about this topic to Microsoft.
Show:
© 2014 Microsoft. All rights reserved.