Editar

Compartir a través de


Set-AzIotHubDevice

Update an IoT Hub device.

Syntax

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

Description

Update an IoT Hub device.

Examples

Example 1

Set-AzIotHubDevice -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -DeviceId "myDevice1" -EdgeEnabled $true

Turn on edge capabilities for device.

Example 2

Set-AzIotHubDevice -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -DeviceId "myDevice1" -Status Disabled

Disable device status.

Example 3

Set-AzIotHubDevice -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -DeviceId "myDevice1" -AuthMethod "x509_ca"

Update authorization type of an Iot Hub device.

Parameters

-AuthMethod

The authorization type an entity is to be created with.

Type:PSDeviceAuthType
Accepted values:shared_private_key, x509_thumbprint, x509_ca
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DeviceId

Target Device Id.

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

-EdgeEnabled

Flag indicating edge enablement.

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

-InputObject

IotHub object

Type:PSIotHub
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-IotHubName

Name of the Iot Hub

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

-PrimaryThumbprint

Explicit self-signed certificate thumbprint to use for primary key.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

Name of the Resource Group

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceId

IotHub Resource Id

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-SecondaryThumbprint

Explicit self-signed certificate thumbprint to use for secondary key.

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

-Status

Set device status upon creation.

Type:PSDeviceStatus
Accepted values:Enabled, Disabled
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-StatusReason

Description for device status.

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

PSIotHub

String

Outputs

PSDevice