diff options
Diffstat (limited to 'SessionCmdlet.cs')
| -rw-r--r-- | SessionCmdlet.cs | 16 |
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; +} |
