Skip to content

Instantly share code, notes, and snippets.

@NateLehman
Created January 11, 2019 10:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NateLehman/4223bbfb9f2b09f5ae642affe7d17181 to your computer and use it in GitHub Desktop.
Save NateLehman/4223bbfb9f2b09f5ae642affe7d17181 to your computer and use it in GitHub Desktop.
using System.Management.Automation;
namespace MyPSModule
{
[Cmdlet("Get", "Foo")]
public class GetFooCommand : PSCmdlet
{
[Parameter]
public string Name { get; set; } = string.Empty;
protected override void EndProcessing()
{
this.WriteObject("Foo is " + this.Name);
base.EndProcessing();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment