diff options
| author | Jake Mannens <jake@asger.xyz> | 2026-05-18 16:59:16 +1000 |
|---|---|---|
| committer | Jake Mannens <jake@asger.xyz> | 2026-05-18 16:59:16 +1000 |
| commit | ab46387d4d02e30b171a7c2fa07947b41ec691a0 (patch) | |
| tree | 0e3311e320de78476917e073d4f2ef954624a24a /SetTagDefinition.cs | |
| parent | 7b17bd8ef7ee8b3391fea3bf7a9e1866be92e81b (diff) | |
Diffstat (limited to 'SetTagDefinition.cs')
| -rw-r--r-- | SetTagDefinition.cs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/SetTagDefinition.cs b/SetTagDefinition.cs new file mode 100644 index 0000000..51a18f4 --- /dev/null +++ b/SetTagDefinition.cs @@ -0,0 +1,31 @@ +using HyperBooru.ApiClient; +using HyperBooru.ApiModels; +using System.Management.Automation; + +namespace HyperBooru.PowerShell; + +[Alias("shbtd")] +[Cmdlet(VerbsCommon.Set, "HyperBooruTagDefinition")] +public class SetTagDefinitionCmdlet : PSCmdlet { + [Parameter(Mandatory = true)] + public required HBSession Session { get; set; } + + [Parameter(Mandatory = true)] + public required Guid TagDefinitionId { get; set; } + + [Parameter] public string? Namespace { get; set; } + [Parameter] public string? Name { get; set; } + [Parameter] public string? Alias { get; set; } + + protected override void ProcessRecord() { + var tagDefinition = Session.Tag.UpdateTagDefinitionAsync( + TagDefinitionId, + new TagUpdateRequest { + Namespace = Namespace, + Name = Name, + Alias = Alias + }).GetAwaiter().GetResult(); + + WriteObject(tagDefinition); + } +} |
