Add Test-MqttConnection and Show-MqttExamples cmdlets, update documentation

Co-authored-by: chkr1011 <6939810+chkr1011@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-07 10:50:42 +00:00
co-authored by chkr1011
parent 07b72e75ed
commit 16f8765562
4 changed files with 149 additions and 1 deletions
+21
View File
@@ -88,6 +88,15 @@ Remove-MqttSession -Session $session
## Available Cmdlets
### Help and Examples
#### Show-MqttExamples
Displays quick examples for common MQTT tasks.
```powershell
Show-MqttExamples
```
### Session Management
#### New-MqttSession
@@ -174,6 +183,18 @@ Disposes the MQTT session and releases resources.
Remove-MqttSession -Session $session
```
#### Test-MqttConnection
Tests if the MQTT connection is alive by sending a PING packet.
```powershell
$isAlive = Test-MqttConnection -Session $session -TimeoutSeconds 5
Write-Host "Connection is alive: $isAlive"
```
**Parameters:**
- `Session`: The MQTT session (mandatory)
- `TimeoutSeconds`: Timeout for the ping operation (default: 5)
### Publishing
#### Publish-MqttMessage