using System.Management.Automation; namespace Noz.PowerShell.Cmdlets; [Cmdlet(VerbsCommon.Find, "NozNote")] [OutputType(typeof(NozSearchHit))] public sealed class FindNozNoteCmdlet : NozCmdletBase { [Parameter(Mandatory = true, Position = 0)] public string Query { get; set; } = ""; [Parameter] public string? Topic { get; set; } [Parameter] public int Limit { get; set; } = 20; protected override void ProcessRecord() { var hits = Run(Api.SearchAsync(Query, Topic, Limit)); foreach (var h in hits) { WriteObject(new NozSearchHit { Slug = h.Slug, Title = h.Title, Description = h.Description, Topic = h.Topic, Status = h.Status, Lang = h.Lang, }); } } }