Muistiinpano
Tämän sivun käyttö edellyttää valtuutusta. Voit yrittää kirjautua sisään tai vaihtaa hakemistoa.
Tämän sivun käyttö edellyttää valtuutusta. Voit yrittää vaihtaa hakemistoa.
This sample shows how to declare a provider class that derives directly from the System.Management.Automation.Provider.CmdletProvider class. It is included here only for completeness.
Demonstrates
Important
Your provider class will most likely derive from one of the following classes and possibly implement other provider interfaces:
- System.Management.Automation.Provider.ItemCmdletProvider class. See AccessDBProviderSample03.
- System.Management.Automation.Provider.ContainerCmdletProvider class. See AccessDBProviderSample04.
- System.Management.Automation.Provider.NavigationCmdletProvider class. See AccessDBProviderSample05.
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
CmdletProviderattribute.Defining a provider class that derives directly from the System.Management.Automation.Provider.CmdletProvider class.
Example
This sample shows how to define a provider class and how to declare the CmdletProvider attribute.
using System.Management.Automation;
using System.Management.Automation.Provider;
using System.ComponentModel;
namespace Microsoft.Samples.PowerShell.Providers
{
#region AccessDBProvider
/// <summary>
/// Simple provider.
/// </summary>
[CmdletProvider("AccessDB", ProviderCapabilities.None)]
public class AccessDBProvider : CmdletProvider
{
}
#endregion AccessDBProvider
}
See Also
System.Management.Automation.Provider.ItemCmdletProvider
System.Management.Automation.Provider.ContainerCmdletProvider
System.Management.Automation.Provider.NavigationCmdletProvider
PowerShell