Skip to content

Latest commit

 

History

History
67 lines (51 loc) · 3.59 KB

File metadata and controls

67 lines (51 loc) · 3.59 KB
description AccessDBProviderSample02
ms.date 09/13/2016
ms.topic reference
title AccessDBProviderSample02

AccessDBProviderSample02

This sample shows how to overwrite the System.Management.Automation.Provider.DriveCmdletProvider.NewDrive* and System.Management.Automation.Provider.DriveCmdletProvider.RemoveDrive* methods to support calls to the New-PSDrive and Remove-PSDrive cmdlets. The provider class in this sample derives from the System.Management.Automation.Provider.DriveCmdletProvider class.

Demonstrates

Important

Your provider class will most likely derive from one of the following classes and possibly implement other provider interfaces:

For more information about choosing which provider class to derive from based on provider features, see Designing Your Windows PowerShell Provider.

This sample demonstrates the following:

Example

This sample shows how to overwrite the System.Management.Automation.Provider.DriveCmdletProvider.NewDrive* and System.Management.Automation.Provider.DriveCmdletProvider.RemoveDrive* methods. For this sample provider, when a drive is created its connection information is stored in an AccessDBPsDriveInfo object.

:::code language="csharp" source="~/../powershell-sdk-samples/SDK-2.0/csharp/AccessDBProviderSample02/AccessDBProviderSample02.cs" range="11-154":::

See Also

System.Management.Automation.Provider.ItemCmdletProvider

System.Management.Automation.Provider.ContainerCmdletProvider

System.Management.Automation.Provider.NavigationCmdletProvider

Designing Your Windows PowerShell Provider