using HyperBooru.ApiClient; using System.Management.Automation; namespace HyperBooru.PowerShell; [Alias("ghbmt")] [Cmdlet(VerbsCommon.Get, "HyperBooruMediaTag")] public class GetMediaTagCmdlet : PSCmdlet { [Parameter(Position = 0, Mandatory = true)] public required HBSession Session { get; set; } [Parameter(Position = 1, Mandatory = true)] public Guid MediaId { get; set; } protected override void ProcessRecord() { var tags = Session.Media.GetTagsAsync(MediaId) .GetAwaiter() .GetResult(); foreach(var td in tags) WriteObject(td); } }