summaryrefslogtreecommitdiff
path: root/AddMediaTag.cs
diff options
context:
space:
mode:
Diffstat (limited to 'AddMediaTag.cs')
-rw-r--r--AddMediaTag.cs22
1 files changed, 22 insertions, 0 deletions
diff --git a/AddMediaTag.cs b/AddMediaTag.cs
new file mode 100644
index 0000000..35541e4
--- /dev/null
+++ b/AddMediaTag.cs
@@ -0,0 +1,22 @@
+using HyperBooru.ApiClient;
+using System.Management.Automation;
+
+namespace HyperBooru.PowerShell;
+
+[Alias("ahbmt")]
+[Cmdlet(VerbsCommon.Add, "HyperBooruMediaTag")]
+public class AddMediaTagCmdlet : PSCmdlet {
+ [Parameter(Position = 0, Mandatory = true)]
+ public required HBSession Session { get; set; }
+
+ [Parameter(Position = 1, Mandatory = true)]
+ public Guid MediaId { get; set; }
+
+ [Parameter(Position = 2, Mandatory = true)]
+ public Guid[] TagId { get; set; }
+
+ protected override void ProcessRecord() =>
+ Session.Media.AddTagsAsync(MediaId, TagId)
+ .GetAwaiter()
+ .GetResult();
+}