Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

AccessDBProviderSample01

 

This sample shows how to declare a provider class that derives directly from the CmdletProvider class. It is included here only for completeness.

Demonstrates

System_CAPS_importantImportant

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:

  • Declaring the CmdletProvider attribute.

  • Defining a provider class that derives directly from the CmdletProvider class.

Example

This sample shows how to define a provider class and how to declare the CmdletProvider attribute.

namespace Microsoft.Samples.PowerShell.Providers
{
  using System.Management.Automation;
  using System.Management.Automation.Provider;

  /// <summary>
  /// This sample shows how to declare a provider class and how to 
  /// declare the CmdletProvider attribute.
  /// </summary>
  [CmdletProvider("AccessDB", ProviderCapabilities.None)]
  public class AccessDBProvider : CmdletProvider
  {
    // Add provider logic here.
  }
}
Show: