diff options
Diffstat (limited to 'RemoveMedia.cs')
| -rw-r--r-- | RemoveMedia.cs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/RemoveMedia.cs b/RemoveMedia.cs new file mode 100644 index 0000000..48ea13e --- /dev/null +++ b/RemoveMedia.cs @@ -0,0 +1,16 @@ +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}"); + } +} |
