summaryrefslogtreecommitdiff
path: root/GetUploadedFile.cs
diff options
context:
space:
mode:
Diffstat (limited to 'GetUploadedFile.cs')
-rw-r--r--GetUploadedFile.cs17
1 files changed, 17 insertions, 0 deletions
diff --git a/GetUploadedFile.cs b/GetUploadedFile.cs
new file mode 100644
index 0000000..ce9c7d9
--- /dev/null
+++ b/GetUploadedFile.cs
@@ -0,0 +1,17 @@
+using HyperBooru.ApiClient;
+using System.Management.Automation;
+
+namespace HyperBooru.PowerShell;
+
+[Alias("ghbuf")]
+[Cmdlet(VerbsCommon.Get, "HyperBooruUploadedFile")]
+public class GetUploadedFileCmdlet : PSCmdlet {
+ [Parameter(Position = 0, Mandatory = true)]
+ public HBSession Session { get; set; }
+
+ [Parameter(Position = 1, Mandatory = true)]
+ public Guid MediaId { get; set; }
+
+ protected override void ProcessRecord() =>
+ WriteObject(Session.Media.GetUploadedFilesAsync(MediaId).GetAwaiter().GetResult());
+}