共用方式為


Get-AzIotHubDeviceTwin

取得裝置對應項。

語法

Get-AzIotHubDeviceTwin
   [-ResourceGroupName] <String>
   [-IotHubName] <String>
   [-DeviceId] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzIotHubDeviceTwin
   [-InputObject] <PSIotHub>
   [-DeviceId] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzIotHubDeviceTwin
   [-ResourceId] <String>
   [-DeviceId] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

取得裝置對應項。 如需相關資訊,請參閱 https://learn.microsoft.com/azure/iot-hub/iot-hub-devguide-device-twins

範例

範例 1

Get-AzIotHubDeviceTwin -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -DeviceId "myDevice1"

傳回裝置對應項物件。

參數

-DefaultProfile

用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。

類型:IAzureContextContainer
別名:AzContext, AzureRmContext, AzureCredential
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-DeviceId

目標裝置標識碼。

類型:String
Position:1
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-InputObject

IotHub 物件

類型:PSIotHub
Position:0
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-IotHubName

IoT 中樞的名稱

類型:String
Position:1
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-ResourceGroupName

資源群組的名稱

類型:String
Position:0
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-ResourceId

IotHub 資源標識碼

類型:String
Position:0
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

輸入

PSIotHub

String

輸出

PSDeviceTwin