summaryrefslogtreecommitdiff
path: root/SessionCmdlet.cs
diff options
context:
space:
mode:
Diffstat (limited to 'SessionCmdlet.cs')
-rw-r--r--SessionCmdlet.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/SessionCmdlet.cs b/SessionCmdlet.cs
new file mode 100644
index 0000000..d823383
--- /dev/null
+++ b/SessionCmdlet.cs
@@ -0,0 +1,16 @@
+using HyperBooru.ApiClient;
+using System.Management.Automation;
+
+namespace HyperBooru.PowerShell;
+
+public abstract class SessionCmdlet : PSCmdlet {
+ [Parameter(Position = 0)]
+ public HBSession Session {
+ get => session ?? GlobalSession!;
+ set => session = value;
+ }
+
+ internal static HBSession? GlobalSession { get; set; }
+
+ private HBSession? session = null;
+}