using System.Management.Automation; namespace HyperBooru.PowerShell; [Alias("rhbm")] [Cmdlet(VerbsCommon.Remove, "HyperBooruMedia")] public class RemoveMediaCmdlet : SessionCmdlet { [Parameter(Mandatory = true)] public Guid MediaId { get; set; } protected override void ProcessRecord() { Session.Media.DeleteAsync(MediaId).GetAwaiter().GetResult(); WriteVerbose($"Removed media item {MediaId}"); } }