From 2aa80a043b7d45d3eacf7cd855cdd2f734e9c15e Mon Sep 17 00:00:00 2001 From: Jake Mannens Date: Fri, 19 Jun 2026 02:34:39 +1000 Subject: v0.19a --- HyperBooru.psd1 | 2 +- PowerShell.csproj | 2 +- RemoveMedia.cs | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 RemoveMedia.cs diff --git a/HyperBooru.psd1 b/HyperBooru.psd1 index f0f0605..e4ed55e 100644 --- a/HyperBooru.psd1 +++ b/HyperBooru.psd1 @@ -1,6 +1,6 @@ @{ RootModule = 'HyperBooru.PowerShell.dll' - ModuleVersion = '0.18' + ModuleVersion = '0.19' CompatiblePSEditions = 'Core' PowershellVersion = '5.1' GUID = '627c3cbf-7fcc-41b3-9716-610b81ef1032' diff --git a/PowerShell.csproj b/PowerShell.csproj index 4ddcb95..f3650a4 100644 --- a/PowerShell.csproj +++ b/PowerShell.csproj @@ -9,7 +9,7 @@ $(AssemblyVersion) HyperBooru.PowerShell Jake Mannens - 0.18-alpha + 0.19-alpha 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}"); + } +} -- cgit v1.3