Assembly: System.Management.Automation (in System.Management.Automation.dll)
A PSDriveInfo object that describes the drive.
Return ValueA PSDriveInfo object that represents the new drive. The returned object can be the same object passed in by the drive parameter or a modified version of it. The default behavior is to return the passed-in PSDriveInfo object. If an error occurs, an error record should be sent to the error pipeline using the WriteError method and null should be returned.
This method gives the provider an opportunity to associate provider-specific data with a drive. This is done by deriving a new class from the passed-in PSDriveInfo object and adding any properties, methods, or fields that are necessary.
To do this, the override of this method should first create an instance of a new derived PSDriveInfo class using the passed-in PSDriveInfo object and then return the derived PSDriveInfo object. (Note that the derived PSDriveInfo class should have a constructor that takes a PSDriveInfo object and that calls the PSDriveInfo private constructor.
For more information about providers, see Windows PowerShell Providers.
Target PlatformsWindows 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.