Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
PowerShell Module
using System;
using System.Management.Automation;
namespace SamplePsModule
{
[Cmdlet(VerbsCommon.Get, "Vignesh")]
public class SampleGet : Cmdlet //Must inherit Cmdlet
{
//Parameters
[Parameter(Mandatory = true)]
public String name { get; set; }
[Parameter(Mandatory = true)]
public String id { get; set; }
[Parameter(Mandatory = true)]
public String category { get; set; }
//Begin Processing
protected override void BeginProcessing()
{
Data data = new Data();
data.name = name;
data.id = id;
data.category = category;
WriteObject(data);
}
}
public class Data
{
public String name { get; set; }
public String id { get; set; }
public String category { get; set; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment