DriveCmdletProvider.InitializeDefaultDrives Method

Gives the provider the ability to map drives after initialization.


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

'Usage
Dim returnValue As Collection(Of PSDriveInfo)

returnValue = Me.InitializeDefaultDrives

'Declaration
Protected Overridable Function InitializeDefaultDrives As Collection(Of PSDriveInfo)
protected Collection<PSDriveInfo> InitializeDefaultDrives ()
protected function InitializeDefaultDrives () : Collection<PSDriveInfo>

Return Value

A collection of PSDriveInfo objects for each drive the provider wants to mount. If no drives should be mounted, an empty collection should be returned.

When the provider engine starts a provider, the InitializeDefaultDrives method is called. This is an opportunity for the provider to mount drives that are important to it. For instance, the Active Directory provider might mount a drive for the defaultNamingContext if the computer is part of a domain.

All providers should mount a root drive to increase discoverability. This root drive might contain a listing of a set of locations that would be interesting as roots for other mounted drives. For example, the Active Directory provider might create a drive that lists the naming contexts found in the namingContext attributes on the RootDSE. This will help users discover interesting mount points for other drives.

This method defines provider-specific functionality for the New-Drive cmdlet. If this implementation of the cmdlet requires addition parameters, the provider must also call the NewDriveDynamicParameters method.

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