diff options
| author | Jake Mannens <jake@asger.xyz> | 2026-06-19 02:34:39 +1000 |
|---|---|---|
| committer | Jake Mannens <jake@asger.xyz> | 2026-06-19 02:34:39 +1000 |
| commit | 2aa80a043b7d45d3eacf7cd855cdd2f734e9c15e (patch) | |
| tree | 74a72ba5ba6a3858941350e91814166250318a73 /RemoveMedia.cs | |
| parent | d36e27387eabf88845d364b9d3a2da54a583247f (diff) | |
v0.19av0.19a
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}"); + } +} |
