using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Management.Automation;
using System.Management.Automation.Runspaces;
namespace mycustom2
{
[RunInstaller(true)]
public class mycustomsnapin : CustomPSSnapIn
{
private Collection<CmdletConfigurationEntry> cmdlets = new Collection<CmdletConfigurationEntry>();
private Collection<ProviderConfigurationEntry> providers = new Collection<ProviderConfigurationEntry>();
private Collection<TypeConfigurationEntry> types = new Collection<TypeConfigurationEntry>();
private Collection<FormatConfigurationEntry> formats = new Collection<FormatConfigurationEntry>();
public mycustomsnapin() : base()
{
cmdlets.Add(new CmdletConfigurationEntry(“get-matches”, typeof(pscommandlet), null));
}
public override string Name
{
get { return “mycustomsnapin”; }
}
public override string Vendor
{
get { return “kn”; }
}
public override string Description
{
get { return “This snap-in is a test.”; }
}
public override Collection<CmdletConfigurationEntry> Cmdlets
{
get { return cmdlets; }
}
public override Collection<ProviderConfigurationEntry> Providers
{
get { return providers; }
}
public override Collection<TypeConfigurationEntry> Types
{
get { return types; }
}
public override Collection<FormatConfigurationEntry> Formats
{
get { return formats; }
}
}
}
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (1)
Commented:
Please run this through Microsoft Word for spell check and use consistency when writing Powershell or powershell or PowerShell.
I found two errors at the top:
Powerhsell
tempaltes
Not trying to take you down, just trying to help :)
-DH