/
githubmirror
/
PowerShell
Обзор
Документация
Войти
/
githubmirror
/
PowerShell
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetVerbCommand.cs
47 строк
1 KB
Armaan Mcleod
Add `-Verb` argument completer for `Get-Verb`/ `Get-Command` and refactor `Get-Verb` (#20286)
16 дек 2023, 19:34
Не верифицирован
16 дек 2023, 19:34
0e18be6
Код
Авторство
О чём код?
// 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> [Cmdlet(VerbsCommon.Get, "Verb", HelpUri = "https://go.microsoft.com/fwlink/?LinkID=2097026")] [OutputType(typeof(VerbInfo))] public class GetVerbCommand : Cmdlet { /// <summary> /// Optional Verb filter. /// </summary> [Parameter(ValueFromPipeline = true, ValueFromPipelineByPropertyName = true, Position = 0)] [ArgumentCompleter(typeof(VerbArgumentCompleter))] public string[] Verb { get; set; } /// <summary> /// Optional Group filter. /// </summary> [Parameter(ValueFromPipeline = true, ValueFromPipelineByPropertyName = true, Position = 1)] [ValidateSet("Common", "Communications", "Data", "Diagnostic", "Lifecycle", "Other", "Security")] 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); } } } }