FindPackageCmdlet.cs (1479B)
1 // ----------------------------------------------------------------------------- 2 // <copyright file="FindPackageCmdlet.cs" company="Microsoft Corporation"> 3 // Copyright (c) Microsoft Corporation. Licensed under the MIT License. 4 // </copyright> 5 // ----------------------------------------------------------------------------- 6 7 namespace Microsoft.WinGet.Client.Commands 8 { 9 using System.Management.Automation; 10 using Microsoft.WinGet.Client.Commands.Common; 11 using Microsoft.WinGet.Client.Common; 12 using Microsoft.WinGet.Client.Engine.Commands; 13 using Microsoft.WinGet.Client.Engine.PSObjects; 14 15 /// <summary> 16 /// Searches configured sources for packages. 17 /// </summary> 18 [Cmdlet(VerbsCommon.Find, Constants.WinGetNouns.Package)] 19 [Alias("fdwgp")] 20 [OutputType(typeof(PSFoundCatalogPackage))] 21 public sealed class FindPackageCmdlet : FinderExtendedCmdlet 22 { 23 /// <summary> 24 /// Searches for configured sources for packages. 25 /// </summary> 26 protected override void ProcessRecord() 27 { 28 var command = new FinderPackageCommand( 29 this, 30 this.Id, 31 this.Name, 32 this.Moniker, 33 this.Source, 34 this.Query, 35 this.Tag, 36 this.Command, 37 this.Count); 38 39 command.Find(this.MatchOption.ToString()); 40 } 41 } 42 }