Advertisement
aetos

Untitled

Nov 14th, 2018
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.75 KB | None | 0 0
  1. using System;
  2. using System.Management.Automation;
  3.  
  4. using JetBrains.Annotations;
  5.  
  6. using PSModule2;
  7.  
  8. namespace TestModule
  9. {
  10.     [Cmdlet("Test", "Hoge")]
  11.     public class TestHogeCommand
  12.     {
  13.         [NotNull]
  14.         private readonly Cmdlet _cmdlet;
  15.  
  16.         public TestHogeCommand(
  17.             [NotNull] ICmdletAccessor cmdletAccessor)
  18.         {
  19.             if (cmdletAccessor == null)
  20.             {
  21.                 throw new ArgumentNullException(nameof(cmdletAccessor));
  22.             }
  23.  
  24.             this._cmdlet = cmdletAccessor.Cmdlet;
  25.         }
  26.  
  27.         public void BeginProcessing()
  28.         {
  29.            
  30.         }
  31.  
  32.         public void ProcessRecord()
  33.         {
  34.             this._cmdlet.WriteObject("ほげー");
  35.         }
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement