Freigeben über


Invoke-AzIotHubDeviceMethod

Rufen Sie eine direkte Methode auf einem Gerät auf.

Syntax

Invoke-AzIotHubDeviceMethod
      [-ResourceGroupName] <String>
      [-IotHubName] <String>
      [-DeviceId] <String>
      -Name <String>
      [-Payload <String>]
      [-ResponseTimeOut <Int32>]
      [-ConnectionTimeOut <Int32>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Invoke-AzIotHubDeviceMethod
      [-InputObject] <PSIotHub>
      [-DeviceId] <String>
      -Name <String>
      [-Payload <String>]
      [-ResponseTimeOut <Int32>]
      [-ConnectionTimeOut <Int32>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Invoke-AzIotHubDeviceMethod
      [-ResourceId] <String>
      [-DeviceId] <String>
      -Name <String>
      [-Payload <String>]
      [-ResponseTimeOut <Int32>]
      [-ConnectionTimeOut <Int32>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Beschreibung

Rufen Sie eine direkte Methode auf einem Gerät auf. Weitere Informationen finden Sie unter https://learn.microsoft.com/azure/iot-hub/iot-hub-devguide-direct-methods.

Beispiele

Beispiel 1

Invoke-AzIotHubDeviceMethod -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -DeviceId "myDevice1" -Name "methodName" -ResponseTimeOut 20 -ConnectionTimeOut 15

Aufrufen einer Gerätemethode.

Parameter

-Confirm

Hiermit werden Sie vor der Ausführung des Cmdlets zur Bestätigung aufgefordert.

Typ:SwitchParameter
Aliases:cf
Position:Named
Standardwert:None
Erforderlich:False
Accept pipeline input:False
Accept wildcard characters:False

-ConnectionTimeOut

Die Anzahl der Sekunden, bis eine Verbindung erfolgreich hergestellt wurde. Der Standardwert ist 10.

Typ:Int32
Position:Named
Standardwert:None
Erforderlich:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

Anmeldeinformationen, Konto, Mandant und Abonnement für die Kommunikation mit Azure

Typ:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Standardwert:None
Erforderlich:False
Accept pipeline input:False
Accept wildcard characters:False

-DeviceId

Zielgeräte-ID.

Typ:String
Position:1
Standardwert:None
Erforderlich:True
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

IotHub-Objekt

Typ:PSIotHub
Position:0
Standardwert:None
Erforderlich:True
Accept pipeline input:True
Accept wildcard characters:False

-IotHubName

Name des Iot Hub

Typ:String
Position:1
Standardwert:None
Erforderlich:True
Accept pipeline input:False
Accept wildcard characters:False

-Name

Der Name der Methode, die auf diesem Gerät aufgerufen werden soll.

Typ:String
Position:Named
Standardwert:None
Erforderlich:True
Accept pipeline input:False
Accept wildcard characters:False

-Payload

Die Nutzlast für die Methode, die auf diesem Gerät aufgerufen werden soll.

Typ:String
Position:Named
Standardwert:None
Erforderlich:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

Name der Ressourcengruppe

Typ:String
Position:0
Standardwert:None
Erforderlich:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceId

IotHub-Ressourcen-ID

Typ:String
Position:0
Standardwert:None
Erforderlich:True
Accept pipeline input:True
Accept wildcard characters:False

-ResponseTimeOut

Die Anzahl der Sekunden, die warten müssen, bis ein Ergebnis von der direkten Methode empfangen wird. Der Standardwert ist 10.

Typ:Int32
Position:Named
Standardwert:None
Erforderlich:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Zeigt, was geschieht, wenn das Cmdlet ausgeführt wird. Das Cmdlet wird nicht ausgeführt.

Typ:SwitchParameter
Aliases:wi
Position:Named
Standardwert:None
Erforderlich:False
Accept pipeline input:False
Accept wildcard characters:False

Eingaben

PSIotHub

String

Ausgaben

PSCloudToDeviceMethodResult