Created
August 27, 2015 14:27
-
-
Save asvignesh/639005d8c4a699527c70 to your computer and use it in GitHub Desktop.
PowerShell Module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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