mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-17 01:33:03 +08:00
Add new PowerShell project
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using System.Management.Automation;
|
||||
|
||||
namespace MQTTnet.PowerShell.Cmdlets;
|
||||
|
||||
[Cmdlet(VerbsCommon.Remove, "MqttSession")]
|
||||
public class RemoveMqttSessionCmdlet : PSCmdlet
|
||||
{
|
||||
[Parameter(Mandatory = true, ValueFromPipeline = true)]
|
||||
public required MqttSession Session { get; set; }
|
||||
|
||||
protected override void ProcessRecord()
|
||||
{
|
||||
Session.Dispose();
|
||||
WriteObject("Session removed.");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user