你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Invoke-AzIotHubModuleMethod
调用 Edge 模块方法。
语法
Invoke-AzIotHubModuleMethod
[-ResourceGroupName] <String>
[-IotHubName] <String>
[-DeviceId] <String>
[-ModuleId] <String>
-Name <String>
[-Payload <String>]
[-ResponseTimeOut <Int32>]
[-ConnectionTimeOut <Int32>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Invoke-AzIotHubModuleMethod
[-InputObject] <PSIotHub>
[-DeviceId] <String>
[-ModuleId] <String>
-Name <String>
[-Payload <String>]
[-ResponseTimeOut <Int32>]
[-ConnectionTimeOut <Int32>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Invoke-AzIotHubModuleMethod
[-ResourceId] <String>
[-DeviceId] <String>
[-ModuleId] <String>
-Name <String>
[-Payload <String>]
[-ResponseTimeOut <Int32>]
[-ConnectionTimeOut <Int32>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
调用 Edge 模块方法。 有关详细信息,请参阅 https://learn.microsoft.com/azure/iot-hub/iot-hub-devguide-direct-methods。
示例
示例 1
Invoke-AzIotHubModuleMethod -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -DeviceId "myDevice1" -ModuleId "myModule1" -Name "methodName" -Payload "method-input" -ResponseTimeOut 20 -ConnectionTimeOut 15
调用 Edge 模块方法。
参数
-Confirm
在运行 cmdlet 之前,提示你进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ConnectionTimeOut
等待的秒数,直到成功建立连接。 默认值为 10。
类型: | Int32 |
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 |
-InputObject
IotHub 对象
类型: | PSIotHub |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-IotHubName
IoT 中心的名称
类型: | String |
Position: | 1 |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-ModuleId
目标设备的模块 ID。
类型: | String |
Position: | 2 |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-Name
在此设备模块上调用的方法的名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-Payload
在此设备模块上调用的方法的有效负载。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ResourceGroupName
资源组的名称
类型: | String |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-ResourceId
IotHub 资源 ID
类型: | String |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-ResponseTimeOut
等待的秒数,直到从直接方法接收结果。 默认值为 10。
类型: | Int32 |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-WhatIf
显示 cmdlet 运行时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |