Get-AzIotHubModuleConnectionString
Get the connection string of a target IoT device module in an Iot Hub.
Syntax
ResourceSet (Default)
Get-AzIotHubModuleConnectionString
[-ResourceGroupName] <String>
[-IotHubName] <String>
[-DeviceId] <String>
[-ModuleId <String>]
[-KeyType <PSKeyType>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzIotHubModuleConnectionString
[-InputObject] <PSIotHub>
[-DeviceId] <String>
[-ModuleId <String>]
[-KeyType <PSKeyType>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
ResourceIdSet
Get-AzIotHubModuleConnectionString
[-ResourceId] <String>
[-DeviceId] <String>
[-ModuleId <String>]
[-KeyType <PSKeyType>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
List connection string of all modules or a specified module of a target IoT device contained within an Azure IoT Hub.
Examples
Example 1
Get-AzIotHubModuleConnectionString -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -Deviceid "myDevice1"
Module Id Connection String
--------- -----------------
module1 HostName=myiothub.azure-devices.net;DeviceId=myDevice1;ModuleId=module1;SharedAccessKey=/X4yj******
module2 HostName=myiothub.azure-devices.net;DeviceId=myDevice1;ModuleId=module2;x509=true
Show all modules connection string of a target IoT device in an Iot Hub.
Example 2
Get-AzIotHubModuleConnectionString -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -DeviceId "myDevice1" -ModuleId "module1" -KeyType secondary
Module Id Connection String
--------- -----------------
module1 HostName=myiothub.azure-devices.net;DeviceId=myDevice1;ModuleId=module1;SharedAccessKey=/X4yj******
Get the secondary module connection string of a target IoT device in an Iot Hub.
Parameters
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
Parameter properties
Type: IAzureContextContainer
Default value: None
Supports wildcards: False
DontShow: False
Aliases: AzContext, AzureRmContext, AzureCredential
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DeviceId
Target Device Id.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: 1
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
IotHub object
Type: PSIotHub
Default value: None
Supports wildcards: False
DontShow: False
InputObjectSet
Position: 0
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-IotHubName
Name of the Iot Hub
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ResourceSet
Position: 1
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-KeyType
Shared access policy key type for auth.
Parameter properties
Type: PSKeyType
Default value: None
Accepted values: primary, secondary
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ModuleId
Target Module Id.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ResourceGroupName
Name of the Resource Group
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ResourceSet
Position: 0
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ResourceId
IotHub Resource Id
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ResourceIdSet
Position: 0
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters .
Outputs