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

protected:
virtual Collection<PSDriveInfo^>^ InitializeDefaultDrives ()
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


Show:
© 2015 Microsoft