AccessDBProviderSample01
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
CmdletProvider
attribute.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
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de 2024, nous allons supprimer progressivement GitHub Issues comme mécanisme de commentaires pour le contenu et le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultezEnvoyer et afficher des commentaires pour