Created
June 17, 2014 16:34
-
-
Save mwjcomputing/946afc678b45c0b7d6fa to your computer and use it in GitHub Desktop.
Testing
This file contains hidden or 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
| [Cmdlet(VerbsCommon.Get, "MWJName")] | |
| public class GetMwjName : PSCmdlet | |
| { | |
| private string _typedName; | |
| [Parameter( | |
| Mandatory = true, | |
| ValueFromPipeline = true, | |
| ValueFromPipelineByPropertyName = true, | |
| Position = 0, | |
| HelpMessage = "Name to say hello to." | |
| )] | |
| [Alias("Person", "FirstName")] | |
| public string Name | |
| { | |
| get { return _typedName; } | |
| set { _typedName = value; } | |
| } | |
| protected override void ProcessRecord() | |
| { | |
| WriteVerbose("Writing name"); | |
| string name = "Hello " + _typedName; | |
| WriteObject(name); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment