From 07cfbfdb92890188cc0bed120acb1fcbf72d34db Mon Sep 17 00:00:00 2001 From: Jake Mannens Date: Mon, 18 May 2026 17:01:02 +1000 Subject: Added default global fallback session context --- SessionCmdlet.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 SessionCmdlet.cs (limited to 'SessionCmdlet.cs') 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; +} -- cgit v1.3