你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Set-AzIotHubDevice
更新 IoT 中心设备。
语法
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>]
说明
更新 IoT 中心设备。
示例
示例 1
Set-AzIotHubDevice -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -DeviceId "myDevice1" -EdgeEnabled $true
为设备启用边缘功能。
示例 2
Set-AzIotHubDevice -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -DeviceId "myDevice1" -Status Disabled
禁用设备状态。
示例 3
Set-AzIotHubDevice -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -DeviceId "myDevice1" -AuthMethod "x509_ca"
更新 Iot 中心设备的授权类型。
参数
-AuthMethod
要创建实体的授权类型。
类型: | PSDeviceAuthType |
接受的值: | shared_private_key, x509_thumbprint, x509_ca |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Confirm
在运行 cmdlet 之前,提示你进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DeviceId
目标设备 ID。
类型: | String |
Position: | 1 |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-EdgeEnabled
指示边缘启用的标志。
类型: | Boolean |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-InputObject
IotHub 对象
类型: | PSIotHub |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-IotHubName
IoT 中心的名称
类型: | String |
Position: | 1 |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-PrimaryThumbprint
用于主密钥的显式自签名证书指纹。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-ResourceGroupName
资源组的名称
类型: | String |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-ResourceId
IotHub 资源 ID
类型: | String |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-SecondaryThumbprint
用于辅助密钥的显式自签名证书指纹。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Status
创建时设置设备状态。
类型: | PSDeviceStatus |
接受的值: | Enabled, Disabled |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-StatusReason
设备状态的说明。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-WhatIf
显示 cmdlet 运行时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |