Delen via


Add-AzIotHubDevice

Maak een apparaat in een IoT Hub.

Syntaxis

Add-AzIotHubDevice
   [-ResourceGroupName] <String>
   [-IotHubName] <String>
   [-DeviceId] <String>
   [-AuthMethod <PSDeviceAuthType>]
   [-Status <PSDeviceStatus>]
   [-StatusReason <String>]
   [-EdgeEnabled]
   [-Children <String[]>]
   [-ParentDeviceId <String>]
   [-Force]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Add-AzIotHubDevice
   [-InputObject] <PSIotHub>
   [-DeviceId] <String>
   [-AuthMethod <PSDeviceAuthType>]
   [-Status <PSDeviceStatus>]
   [-StatusReason <String>]
   [-EdgeEnabled]
   [-Children <String[]>]
   [-ParentDeviceId <String>]
   [-Force]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Add-AzIotHubDevice
   [-ResourceId] <String>
   [-DeviceId] <String>
   [-AuthMethod <PSDeviceAuthType>]
   [-Status <PSDeviceStatus>]
   [-StatusReason <String>]
   [-EdgeEnabled]
   [-Children <String[]>]
   [-ParentDeviceId <String>]
   [-Force]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Maak een apparaat met een ander autorisatietype in een IoT Hub.

Voorbeelden

Voorbeeld 1

Add-AzIotHubDevice -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -DeviceId "myDevice1" -AuthMethod "shared_private_key" -EdgeEnabled

Een IoT-apparaat met edge maken met standaardautorisatie (gedeelde persoonlijke sleutel).

Voorbeeld 2

Add-AzIotHubDevice -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -DeviceId "myDevice2" -AuthMethod "x509_ca" -Status Disabled -StatusReason "Some Reason"

Maak een IoT-apparaat met ca-basisautorisatie met uitgeschakelde status en reden.

Voorbeeld 3

Add-AzIotHubDevice -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -DeviceId "myDevice1" -AuthMethod "shared_private_key" -EdgeEnabled -Children device1,device2

Maak een IoT-apparaat met edge en voeg onderliggende apparaten eraan toe.

Voorbeeld 4

Add-AzIotHubDevice -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -DeviceId "myDevice1" -AuthMethod "shared_private_key" -ParentDeviceId parentDevice1

Maak een IoT-apparaat en stel het bovenliggende apparaat in.

Parameters

-AuthMethod

Het autorisatietype waarmee een entiteit moet worden gemaakt.

Type:PSDeviceAuthType
Geaccepteerde waarden:shared_private_key, x509_thumbprint, x509_ca
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-Children

De lijst met onderliggende apparaten toevoegen (door komma's gescheiden) bevat alleen niet-edge-apparaten.

Type:String[]
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-Confirm

U wordt gevraagd om bevestiging voordat u de cmdlet uitvoert.

Type:SwitchParameter
Aliassen:cf
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-DefaultProfile

De referenties, accounts, tenants en abonnementen die worden gebruikt voor communicatie met Azure.

Type:IAzureContextContainer
Aliassen:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-DeviceId

Doelapparaat-id.

Type:String
Position:1
Default value:None
Vereist:True
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-EdgeEnabled

Vlag die aangeeft dat edge is ingeschakeld.

Type:SwitchParameter
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-Force

Overschrijft het bovenliggende apparaat van het niet-edge-apparaat.

Type:SwitchParameter
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-InputObject

IotHub-object

Type:PSIotHub
Position:0
Default value:None
Vereist:True
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-IotHubName

Naam van de IoT-hub

Type:String
Position:1
Default value:None
Vereist:True
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-ParentDeviceId

Id van edge-apparaat.

Type:String
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-PrimaryThumbprint

Expliciete zelfondertekende certificaatvingerafdruk die moet worden gebruikt voor primaire sleutel.

Type:String
Position:Named
Default value:None
Vereist:True
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-ResourceGroupName

Naam van de resourcegroep

Type:String
Position:0
Default value:None
Vereist:True
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-ResourceId

IotHub-resource-id

Type:String
Position:0
Default value:None
Vereist:True
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-SecondaryThumbprint

Expliciete zelfondertekende certificaatvingerafdruk voor secundaire sleutel.

Type:String
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-Status

Stel de apparaatstatus in bij het maken.

Type:PSDeviceStatus
Geaccepteerde waarden:Enabled, Disabled
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-StatusReason

Beschrijving voor apparaatstatus.

Type:String
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-WhatIf

Toont wat er zou gebeuren als de cmdlet wordt uitgevoerd. De cmdlet wordt niet uitgevoerd.

Type:SwitchParameter
Aliassen:wi
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

Invoerwaarden

PSIotHub

String

Uitvoerwaarden

PSDevice