共用方式為


Set-AzIotHubMessageEnrichment

更新IoT中樞中的訊息擴充。

語法

Set-AzIotHubMessageEnrichment
   [-ResourceGroupName] <String>
   [-Name] <String>
   [-Key] <String>
   [-Value <String>]
   [-Endpoint <String[]>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzIotHubMessageEnrichment
   [-InputObject] <PSIotHub>
   [-Key] <String>
   [-Value <String>]
   [-Endpoint <String[]>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzIotHubMessageEnrichment
   [-ResourceId] <String>
   [-Key] <String>
   [-Value <String>]
   [-Endpoint <String[]>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

如需 Azure IoT 中樞訊息擴充的詳細說明,請參閱 https://learn.microsoft.com/azure/iot-hub/iot-hub-message-enrichments-overview

範例

範例 1

Set-AzIotHubMessageEnrichment -ResourceGroupName "myresourcegroup" -Name "myiothub" -Key "newKey" -Value "updatedValue"

Key         : newKey
Value       : updatedValue
Endpoint(s) : {endpoint1, endpoint2}

將擴充的值更新為索引鍵 「newKey」 的 「updatedValue」。。 如需 Azure IoT 中樞訊息擴充的詳細說明,請參閱 https://learn.microsoft.com/azure/iot-hub/iot-hub-message-enrichments-overview

範例 2

Set-AzIotHubMessageEnrichment -ResourceGroupName "myresourcegroup" -Name "myiothub" -Key "newKey" -Endpoint endpoint1,endpoint2,endpoint3

Key         : newKey
Value       : value1
Endpoint(s) : {endpoint1, endpoint2, endpoint3}

將擴充的端點更新為密鑰 “newKey” 的 “endpoint1, endpoint3”。 如需 Azure IoT 中樞訊息擴充的詳細說明,請參閱 https://learn.microsoft.com/azure/iot-hub/iot-hub-message-enrichments-overview

參數

-Confirm

在執行 Cmdlet 之前,提示您進行確認。

類型:SwitchParameter
別名:cf
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-DefaultProfile

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

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

-Endpoint

要套用擴充的 Endpoint(s) 。

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

-InputObject

IotHub 物件

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

-Key

擴充的索引鍵。

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

-Name

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

-Value

擴充的值。

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

-WhatIf

顯示 Cmdlet 執行時會發生什麼事。 Cmdlet 未執行。

類型:SwitchParameter
別名:wi
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

輸入

PSIotHub

String

輸出

PSEnrichmentMetadata