summaryrefslogtreecommitdiff
path: root/RemoveUser.cs
blob: 0e286750d436fccf4207b39acae0d8e3c5b69848 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using HyperBooru.ApiClient;
using System.Management.Automation;

namespace HyperBooru.PowerShell;

[Alias("rhbu")]
[Cmdlet(VerbsCommon.Remove, "HyperBooruUser")]
public class RemoveUserCmdlet : PSCmdlet {
    [Parameter(Position = 0, Mandatory = true)]
    public HBSession Session { get; set; }

    [Parameter(Position = 1, Mandatory = true)]
    public Guid UserId { get; set; }

    protected override void ProcessRecord() {
        Session.User.DeleteUserAsync(UserId)
            .GetAwaiter()
            .GetResult();
    }
}