summaryrefslogtreecommitdiff
path: root/SessionCmdlet.cs
blob: d8233837192eda3af1aaab022de11f7e5bb1d1bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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;
}