summaryrefslogtreecommitdiff
path: root/SetImplicitTag.cs
diff options
context:
space:
mode:
Diffstat (limited to 'SetImplicitTag.cs')
-rw-r--r--SetImplicitTag.cs17
1 files changed, 17 insertions, 0 deletions
diff --git a/SetImplicitTag.cs b/SetImplicitTag.cs
new file mode 100644
index 0000000..8d11f1c
--- /dev/null
+++ b/SetImplicitTag.cs
@@ -0,0 +1,17 @@
+using HyperBooru.ApiClient;
+using System.Management.Automation;
+
+namespace HyperBooru.PowerShell;
+
+[Alias("shbit")]
+[Cmdlet(VerbsCommon.Set, "HyperBooruImplicitTag")]
+public class SetImplicitTagCmdlet : PSCmdlet {
+ [Parameter(Mandatory = true)] public required HBSession Session { get; set; }
+ [Parameter(Mandatory = true)] public required Guid TagDefinitionId { get; set; }
+ [Parameter(Mandatory = true)] public required Guid[] ImplicitTagId { get; set; }
+
+ protected override void ProcessRecord() =>
+ Session.Tag.ReplaceImplicitTagsAsync(TagDefinitionId, ImplicitTagId)
+ .GetAwaiter()
+ .GetResult();
+}