Windows-powershell / PowerShell-master /src /Microsoft.PowerShell.Commands.Utility /commands /utility /GetVerbCommand.cs
| // Copyright (c) Microsoft Corporation. | |
| // Licensed under the MIT License. | |
| using System.Management.Automation; | |
| using static System.Management.Automation.Verbs; | |
| namespace Microsoft.PowerShell.Commands | |
| { | |
| /// <summary> | |
| /// Implementation of the Get Verb Command. | |
| /// </summary> | |
| [] | |
| [] | |
| public class GetVerbCommand : Cmdlet | |
| { | |
| /// <summary> | |
| /// Optional Verb filter. | |
| /// </summary> | |
| [] | |
| [] | |
| public string[] Verb | |
| { | |
| get; set; | |
| } | |
| /// <summary> | |
| /// Optional Group filter. | |
| /// </summary> | |
| [] | |
| [] | |
| public string[] Group | |
| { | |
| get; set; | |
| } | |
| /// <summary> | |
| /// Returns a list of verbs. | |
| /// </summary> | |
| protected override void ProcessRecord() | |
| { | |
| foreach (VerbInfo verb in FilterByVerbsAndGroups(Verb, Group)) | |
| { | |
| WriteObject(verb); | |
| } | |
| } | |
| } | |
| } | |