Skip to content

Commit 7984951

Browse files
anusapanmsJinLei
andauthored
{IotHub} Added new examples for hashtable type parameter (#13532)
* Added new examples for hashtable type parameter * Update ChangeLog.md * Update changelog.md Co-authored-by: Jin Lei <[email protected]>
1 parent af01177 commit 7984951

12 files changed

+87
-15
lines changed

src/DeviceProvisioningServices/DeviceProvisioningServices/help/Add-AzIoTDeviceProvisioningServiceEnrollment.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ Create an enrollment with attestation type X509
7878
```powershell
7979
PS C:\> $tag = @{}
8080
PS C:\> $tag.Add("environment","test")
81-
PS C:\> Add-AzIoTDeviceProvisioningServiceEnrollment -ResourceGroupName "myresourcegroup" -DpsName "mydps" -RegistrationId "enroll1" -AttestationType SymmetricKey -tag $tag
81+
PS C:\> $desired = @{}
82+
PS C:\> $desired.add("version_dps", "dps1")
83+
PS C:\> Add-AzIoTDeviceProvisioningServiceEnrollment -ResourceGroupName "myresourcegroup" -DpsName "mydps" -RegistrationId "enroll1" -AttestationType SymmetricKey -tag $tag -Desired $desired
8284
```
8385

8486
Create an enrollment with attestation type SymmetricKey and initial twin state.

src/DeviceProvisioningServices/DeviceProvisioningServices/help/Add-AzIoTDeviceProvisioningServiceEnrollmentGroup.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ Create an enrollment with attestation type X509
6868
```powershell
6969
PS C:\> $tag = @{}
7070
PS C:\> $tag.Add("environment","test")
71-
PS C:\> Add-AzIoTDeviceProvisioningServiceEnrollmentGroup -ResourceGroupName "myresourcegroup" -DpsName "mydps" -Name "enroll1" -AttestationType SymmetricKey -tag $tag
71+
PS C:\> $desired = @{}
72+
PS C:\> $desired.add("version_dps", "dps1")
73+
PS C:\> Add-AzIoTDeviceProvisioningServiceEnrollmentGroup -ResourceGroupName "myresourcegroup" -DpsName "mydps" -Name "enroll1" -AttestationType SymmetricKey -tag $tag -Desired $desired
7274
```
7375

7476
Create an enrollment with attestation type SymmetricKey and initial twin state.

src/DeviceProvisioningServices/DeviceProvisioningServices/help/Set-AzIoTDeviceProvisioningServiceEnrollment.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,17 @@ PS C:\> Set-AzIoTDeviceProvisioningServiceEnrollment -ResourceGroupName "myresou
5353

5454
Update allocation policy and hubs for an enrollment record.
5555

56+
### Example 2
57+
```powershell
58+
PS C:\> $tag = @{}
59+
PS C:\> $tag.Add("environment","updatedenv")
60+
PS C:\> $desired = @{}
61+
PS C:\> $desired.add("version_dps", "updateddps")
62+
PS C:\> Set-AzIoTDeviceProvisioningServiceEnrollment -ResourceGroupName "myresourcegroup" -DpsName "mydps" -RegistrationId "enroll1" -tag $tag -Desired $desired
63+
```
64+
65+
Update an enrollment's initial twin state.
66+
5667
## PARAMETERS
5768

5869
### -AllocationPolicy

src/DeviceProvisioningServices/DeviceProvisioningServices/help/Set-AzIoTDeviceProvisioningServiceEnrollmentGroup.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ PS C:\> Set-AzIoTDeviceProvisioningServiceEnrollmentGroup -ResourceGroupName "my
5151

5252
Update allocation policy and hubs for an enrollment group.
5353

54+
### Example 2
55+
```powershell
56+
PS C:\> $tag = @{}
57+
PS C:\> $tag.Add("environment","updatedenv")
58+
PS C:\> $desired = @{}
59+
PS C:\> $desired.add("version_dps", "updateddps")
60+
PS C:\> Set-AzIoTDeviceProvisioningServiceEnrollmentGroup -ResourceGroupName "myresourcegroup" -DpsName "mydps" -Name "enroll1" -tag $tag -Desired $desired
61+
```
62+
63+
Update an enrollment group's initial twin state.
64+
5465
## PARAMETERS
5566

5667
### -AllocationPolicy

src/DeviceProvisioningServices/DeviceProvisioningServices/help/Update-AzIoTDeviceProvisioningService.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ Update Allocation Policy to "GeoLatency" of an Azure IoT Hub device provisioning
7676

7777
### Example 2
7878
```
79-
PS C:\> Update-AzIoTDeviceProvisioningService -ResourceGroupName "myresourcegroup" -Name "myiotdps" -Tag @tags
79+
PS C:\> $tag = @{}
80+
PS C:\> $tag.Add("key1","Value1")
81+
PS C:\> Update-AzIoTDeviceProvisioningService -ResourceGroupName "myresourcegroup" -Name "myiotdps" -Tag $tag
8082
8183
ResourceGroupName : myresourcegroup
8284
Name : myiotdps
@@ -91,11 +93,13 @@ SkuTier : Standard
9193
Etag : AAAAAAAPoOk=
9294
```
9395

94-
Add "@tags" to the Tag of an Azure IoT Hub device provisioning service "myiotdps".
96+
Add tags to an Azure IoT Hub device provisioning service "myiotdps".
9597

9698
### Example 3
9799
```
98-
PS C:\> Get-AzIoTDps -ResourceGroupName "myresourcegroup" -Name "myiotdps" | Update-AzIoTDps -Tag @tags -Reset
100+
PS C:\> $tag = @{}
101+
PS C:\> $tag.Add("key1","Value1")
102+
PS C:\> Get-AzIoTDps -ResourceGroupName "myresourcegroup" -Name "myiotdps" | Update-AzIoTDps -Tag $tag -Reset
99103
100104
ResourceGroupName : myresourcegroup
101105
Name : myiotdps
@@ -110,7 +114,7 @@ SkuTier : Standard
110114
Etag : AAAAAAAS1dY=
111115
```
112116

113-
Delete Tag and add new "@tags" to the Tag of an Azure IoT Hub device provisioning service "myiotdps" using pipeline.
117+
Delete Tag and add new tags to an Azure IoT Hub device provisioning service "myiotdps" using pipeline.
114118

115119
## PARAMETERS
116120

src/IotHub/IotHub/help/Add-AzIotHubConfiguration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ PS C:\> Add-AzIotHubConfiguration -ResourceGroupName "myresourcegroup" -IotHubNa
5858

5959
Create a device configuration with a priority of 3 that applies on condition when a device is tagged in building 9 and the environment is 'test'.
6060

61-
### Example 2
61+
### Example 3
6262
```powershell
6363
PS C:\> $metrics = @{}
6464
PS C:\> $metrics.add("query1", "select deviceId from devices where tags.location='US'")
@@ -67,7 +67,7 @@ PS C:\> Add-AzIotHubConfiguration -ResourceGroupName "myresourcegroup" -IotHubNa
6767

6868
Create a device configuration with user metrics.
6969

70-
### Example 3
70+
### Example 4
7171
```powershell
7272
PS C:\> $labels = @{}
7373
PS C:\> $labels.add("key0","value0")
@@ -77,7 +77,7 @@ PS C:\> Add-AzIotHubConfiguration -ResourceGroupName "myresourcegroup" -IotHubNa
7777

7878
Create a device configuration with labels.
7979

80-
### Example 4
80+
### Example 5
8181
```powershell
8282
PS C:\> $prop = @{}
8383
PS C:\> $prop.add("Location", "US")

src/IotHub/IotHub/help/Add-AzIotHubDeployment.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ Create an Edge deployment with labels.
7474

7575
### Example 4
7676
```powershell
77-
PS C:\> Add-AzIotHubDeployment -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -Name "deploy1" -ModulesContent $content
77+
PS C:\> $content = Get-Content "C:/Edge/modules.json" | ConvertFrom-Json -AsHashtable
78+
PS C:\> Add-AzIotHubDeployment -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -Name "deploy1" -ModulesContent $content -TargetCondition "from devices.modules where tags.environment='test'"
7879
```
7980

8081
Create an Edge deployment with content.

src/IotHub/IotHub/help/Set-AzIotHubConfiguration.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,17 @@ PS C:\> Set-AzIotHubConfiguration -ResourceGroupName "myresourcegroup" -IotHubNa
4747

4848
Alter the priority of a device configuration and update its target condition
4949

50+
### Example 2
51+
```powershell
52+
PS C:\> $labels = @{}
53+
PS C:\> $labels.add("key0","value0")
54+
PS C:\> $metrics = @{}
55+
PS C:\> $metrics.add("query1", "select deviceId from devices where tags.location='US'")
56+
PS C:\> Set-AzIotHubConfiguration -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -Name "config1" -Label $labels -Metric $metrics
57+
```
58+
59+
Update the metrics and labels of a device configuration
60+
5061
## PARAMETERS
5162

5263
### -DefaultProfile

src/IotHub/IotHub/help/Set-AzIotHubDeployment.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,17 @@ PS C:\> Set-AzIotHubDeployment -ResourceGroupName "myresourcegroup" -IotHubName
4747

4848
Alter the priority of IoT Edge deployment and update its target condition.
4949

50+
### Example 2
51+
```powershell
52+
PS C:\> $labels = @{}
53+
PS C:\> $labels.add("key0","value0")
54+
PS C:\> $metrics = @{}
55+
PS C:\> $metrics.add("query1", "select deviceId from devices where tags.location='US'")
56+
PS C:\> Set-AzIotHubDeployment -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -Name "deploy1" -Label $labels -Metric $metrics
57+
```
58+
59+
Update the metrics and labels of IoT Edge deployment.
60+
5061
## PARAMETERS
5162

5263
### -DefaultProfile

src/IotHub/IotHub/help/Test-AzIotHubRoute.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,19 @@ Syntax error. error 1 29 1 30
9595

9696
Test a specific route and showing the reason of failure.
9797

98+
### Example 4
99+
```
100+
PS C:\> $ap = @{}
101+
PS C:\> $ap.add("key0","value0")
102+
PS C:\> $sp = @{}
103+
PS C:\> $sp.add("key1", "value1")
104+
PS C:\> Test-AzIotHubRoute -ResourceGroupName "myresourcegroup" -Name "myiothub" -RouteName R1 -AppProperty $ap -SystemProperty $sp
105+
106+
Result : true
107+
```
108+
109+
Test a specific route with AppProperty and SystemProperty.
110+
98111
## PARAMETERS
99112

100113
### -AppProperty

0 commit comments

Comments
 (0)