Skip to main content

Connect-MQTTBroker

SYNOPSIS

SYNTAX

Connect-MQTTBroker [-Hostname] <String> [[-Port] <Int32>] [[-Username] <String>] [[-Password] <SecureString>]
[-TLS] [<CommonParameters>]

DESCRIPTION

This function establishes a session with the MQTT broker and returns a session object that should then be passed along when using other cmdlets.

EXAMPLES

EXAMPLE 1

$MQTTSession = Connect-MQTTBroker -Hostname mqttbroker.contoso.com -Port 1234 -Username mqttuser -Password (ConvertTo-SecureString -String 'P@ssw0rd1' -AsPlainText -Force)

PARAMETERS

-Hostname

Defines the hostname of the MQTT Broker to connect to

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Port

Defines the port of the MQTT Broker. Defaults to 1883.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-Username

Defines the username to use when connecting to the MQTT broker

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Password

Defines the password (securestring) to use when connecting to the MQTT Broker

Type: SecureString
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-TLS

Defines if the connection should be encrypted

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES

EDIT THIS DOC

This page was auto-generated from the powershell command comment based help. To edit the content of this page, update the script file comment based help on github Github