Skip to content

Commit

Permalink
Split Az.DeviceProvisioningServices Examples (#17094)
Browse files Browse the repository at this point in the history
  • Loading branch information
CaptainFanZzz authored Mar 1, 2022
1 parent 82c20eb commit 3ff3183
Show file tree
Hide file tree
Showing 27 changed files with 171 additions and 109 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
external help file: Microsoft.Azure.PowerShell.Cmdlets.DeviceProvisioningServices.dll-Help.xml
Module Name: Az.DeviceProvisioningServices
online version: https://docs.microsoft.com/powershell/module/az.deviceprovisioningservices/add-aziotdeviceprovisioningserviceaccesspolicy
Expand Down Expand Up @@ -38,9 +38,11 @@ For an introduction to Azure IoT Hub Device Provisioning Service, see https://do
## EXAMPLES

### Example 1
```powershell
Add-AzIoTDeviceProvisioningServiceAccessPolicy -ResourceGroupName "myresourcegroup" -Name "myiotdps" -KeyName "mypolicy" -Permissions "ServiceConfig, EnrollmentWrite"
```
PS C:\> Add-AzIoTDeviceProvisioningServiceAccessPolicy -ResourceGroupName "myresourcegroup" -Name "myiotdps" -KeyName "mypolicy" -Permissions "ServiceConfig, EnrollmentWrite"

```output
ResourceGroupName : myresourcegroup
Name : myiotdps
KeyName : mypolicy
Expand All @@ -52,9 +54,11 @@ Rights : ServiceConfig, EnrollmentWrite
Add a new shared access policy in an Azure IoT Hub device provisioning service with EnrollmentWrite and ServiceConfig rights.

### Example 2
```powershell
Add-AzIoTDpsAccessPolicy -ResourceGroupName "myresourcegroup" -Name "myiotdps" -KeyName "mypolicy2" -Permissions "EnrollmentRead"
```
PS C:\> Add-AzIoTDpsAccessPolicy -ResourceGroupName "myresourcegroup" -Name "myiotdps" -KeyName "mypolicy2" -Permissions "EnrollmentRead"

```output
KeyName Rights
------- ------
mypolicy1 ServiceConfig, EnrollmentWrite
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
external help file: Microsoft.Azure.PowerShell.Cmdlets.DeviceProvisioningServices.dll-Help.xml
Module Name: Az.DeviceProvisioningServices
online version: https://docs.microsoft.com/powershell/module/az.deviceprovisioningservices/add-aziotdeviceprovisioningservicecertificate
Expand Down Expand Up @@ -40,9 +40,11 @@ For a detailed explanation of CA certificates in Azure IoT Hub Device Provisioni
## EXAMPLES

### Example 1
```powershell
Add-AzIoTDeviceProvisioningServiceCertificate -ResourceGroupName "myresourcegroup" -Name "myiotdps" -CertificateName "mycertificate" -Path "c:\mycertificate.cer"
```
PS C:\> Add-AzIoTDeviceProvisioningServiceCertificate -ResourceGroupName "myresourcegroup" -Name "myiotdps" -CertificateName "mycertificate" -Path "c:\mycertificate.cer"

```output
Id : /subscriptions/377cxxxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Microsoft.Devices/provisioningServices/myiotdps/certificates/mycertificate
ResourceGroupName : myresourcegroup
Name : myiotdps
Expand All @@ -58,9 +60,11 @@ Etag : AAAAAAFpGcA=
Upload a CA certificate CER file to an Azure IoT Hub device provisioning service.

### Example 2
```powershell
Add-AzIoTDpsCertificate -ResourceGroupName "myresourcegroup" -Name "myiotdps" -CertificateName "mycertificate" -Path "c:\mycertificate.cer" -Etag "AAAAAAFpGcA="
```
PS C:\> Add-AzIoTDpsCertificate -ResourceGroupName "myresourcegroup" -Name "myiotdps" -CertificateName "mycertificate" -Path "c:\mycertificate.cer" -Etag "AAAAAAFpGcA="

```output
Id : /subscriptions/377cxxxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Microsoft.Devices/provisioningServices/myiothub/certificates/mycertificate
ResourceGroupName : myresourcegroup
Name : myiotdps
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
external help file: Microsoft.Azure.PowerShell.Cmdlets.DeviceProvisioningServices.dll-Help.xml
Module Name: Az.DeviceProvisioningServices
online version: https://docs.microsoft.com/powershell/module/az.deviceprovisioningservices/add-aziotdeviceprovisioningserviceenrollment
Expand Down Expand Up @@ -55,32 +55,32 @@ Create a device enrollment in an Azure IoT Hub Device Provisioning Service.

### Example 1
```powershell
PS C:\> Add-AzIoTDeviceProvisioningServiceEnrollment -ResourceGroupName "myresourcegroup" -DpsName "mydps" -RegistrationId "enroll1" -AttestationType SymmetricKey
Add-AzIoTDeviceProvisioningServiceEnrollment -ResourceGroupName "myresourcegroup" -DpsName "mydps" -RegistrationId "enroll1" -AttestationType SymmetricKey
```

Create an enrollment with attestation type SymmetricKey

### Example 2
```powershell
PS C:\> Add-AzIoTDeviceProvisioningServiceEnrollment -ResourceGroupName "myresourcegroup" -DpsName "mydps" -RegistrationId "enroll1" -AttestationType Tpm -EndorsementKey "endorementkey"
Add-AzIoTDeviceProvisioningServiceEnrollment -ResourceGroupName "myresourcegroup" -DpsName "mydps" -RegistrationId "enroll1" -AttestationType Tpm -EndorsementKey "endorementkey"
```

Create an enrollment with TPM attestation.

### Example 3
```powershell
PS C:\> Add-AzIoTDeviceProvisioningServiceEnrollment -ResourceGroupName "myresourcegroup" -DpsName "mydps" -RegistrationId "enroll1" -AttestationType X509 -PrimaryCertificate "D:/primary.cer"
Add-AzIoTDeviceProvisioningServiceEnrollment -ResourceGroupName "myresourcegroup" -DpsName "mydps" -RegistrationId "enroll1" -AttestationType X509 -PrimaryCertificate "D:/primary.cer"
```

Create an enrollment with attestation type X509

### Example 4
```powershell
PS C:\> $tag = @{}
PS C:\> $tag.Add("environment","test")
PS C:\> $desired = @{}
PS C:\> $desired.add("version_dps", "dps1")
PS C:\> Add-AzIoTDeviceProvisioningServiceEnrollment -ResourceGroupName "myresourcegroup" -DpsName "mydps" -RegistrationId "enroll1" -AttestationType SymmetricKey -tag $tag -Desired $desired
$tag = @{}
$tag.Add("environment","test")
$desired = @{}
$desired.add("version_dps", "dps1")
Add-AzIoTDeviceProvisioningServiceEnrollment -ResourceGroupName "myresourcegroup" -DpsName "mydps" -RegistrationId "enroll1" -AttestationType SymmetricKey -tag $tag -Desired $desired
```

Create an enrollment with attestation type SymmetricKey and initial twin state.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
external help file: Microsoft.Azure.PowerShell.Cmdlets.DeviceProvisioningServices.dll-Help.xml
Module Name: Az.DeviceProvisioningServices
online version: https://docs.microsoft.com/powershell/module/az.deviceprovisioningservices/add-aziotdeviceprovisioningserviceenrollmentgroup
Expand Down Expand Up @@ -52,25 +52,25 @@ Create an enrollment group in an Azure IoT Hub Device Provisioning Service.

### Example 1
```powershell
PS C:\> Add-AzIoTDeviceProvisioningServiceEnrollmentGroup -ResourceGroupName "myresourcegroup" -DpsName "mydps" -Name "enroll1" -AttestationType SymmetricKey
Add-AzIoTDeviceProvisioningServiceEnrollmentGroup -ResourceGroupName "myresourcegroup" -DpsName "mydps" -Name "enroll1" -AttestationType SymmetricKey
```

Create an enrollment with attestation type SymmetricKey

### Example 2
```powershell
PS C:\> Add-AzIoTDeviceProvisioningServiceEnrollmentGroup -ResourceGroupName "myresourcegroup" -DpsName "mydps" -Name "enroll1" -AttestationType X509 -PrimaryCertificate "D:/primary.cer"
Add-AzIoTDeviceProvisioningServiceEnrollmentGroup -ResourceGroupName "myresourcegroup" -DpsName "mydps" -Name "enroll1" -AttestationType X509 -PrimaryCertificate "D:/primary.cer"
```

Create an enrollment with attestation type X509

### Example 3
```powershell
PS C:\> $tag = @{}
PS C:\> $tag.Add("environment","test")
PS C:\> $desired = @{}
PS C:\> $desired.add("version_dps", "dps1")
PS C:\> Add-AzIoTDeviceProvisioningServiceEnrollmentGroup -ResourceGroupName "myresourcegroup" -DpsName "mydps" -Name "enroll1" -AttestationType SymmetricKey -tag $tag -Desired $desired
$tag = @{}
$tag.Add("environment","test")
$desired = @{}
$desired.add("version_dps", "dps1")
Add-AzIoTDeviceProvisioningServiceEnrollmentGroup -ResourceGroupName "myresourcegroup" -DpsName "mydps" -Name "enroll1" -AttestationType SymmetricKey -tag $tag -Desired $desired
```

Create an enrollment with attestation type SymmetricKey and initial twin state.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
external help file: Microsoft.Azure.PowerShell.Cmdlets.DeviceProvisioningServices.dll-Help.xml
Module Name: Az.DeviceProvisioningServices
online version: https://docs.microsoft.com/powershell/module/az.deviceprovisioningservices/add-aziotdeviceprovisioningservicelinkedhub
Expand Down Expand Up @@ -39,9 +39,11 @@ For an introduction to Azure IoT Hub Device Provisioning Service, see https://do
## EXAMPLES

### Example 1
```powershell
Add-AzIoTDeviceProvisioningServiceLinkedHub -ResourceGroupName "myresourcegroup" -Name "myiotdps" -IotHubConnectionString $hubConnectionString -IotHubLocation "eastus"
```
PS C:\> Add-AzIoTDeviceProvisioningServiceLinkedHub -ResourceGroupName "myresourcegroup" -Name "myiotdps" -IotHubConnectionString $hubConnectionString -IotHubLocation "eastus"

```output
ResourceGroupName : myresourcegroup
Name : myiotdps
LinkedHubName : myiothub.azure-devices.net
Expand All @@ -54,9 +56,11 @@ Location : eastus
Linked IoT hub to an Azure IoT Hub device provisioning service.

### Example 2
```powershell
Add-AzIoTDpsHub -ResourceGroupName "myresourcegroup" -Name "myiotdps" -IotHubConnectionString $hubConnectionString -IotHubLocation "eastus" -AllocationWeight 10 -ApplyAllocationPolicy $false
```
PS C:\> Add-AzIoTDpsHub -ResourceGroupName "myresourcegroup" -Name "myiotdps" -IotHubConnectionString $hubConnectionString -IotHubLocation "eastus" -AllocationWeight 10 -ApplyAllocationPolicy $false

```output
LinkedHubName Location AllocationWeight ApplyAllocationPolicy
------------- -------- ---------------- ---------------------
myiothub1.azure-devices.net eastus 2 true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
external help file: Microsoft.Azure.PowerShell.Cmdlets.DeviceProvisioningServices.dll-Help.xml
Module Name: Az.DeviceProvisioningServices
online version: https://docs.microsoft.com/powershell/module/az.deviceprovisioningservices/get-aziotdeviceprovisioningservice
Expand Down Expand Up @@ -30,9 +30,11 @@ For an introduction to Azure IoT Hub Device Provisioning Service, see https://do
## EXAMPLES

### Example 1
```powershell
Get-AzIoTDeviceProvisioningService
```
PS C:\> Get-AzIoTDeviceProvisioningService

```output
ResourceGroupName Name Location ServiceOperationsHostName IotHubs AllocationPolicy Tags State
----------------- ---- -------- ------------------------- ------- ---------------- ---- -----
myresourcegroup0 myiotdps0 eastus myiotdps0.azure-devices-provisioning.net 0 Static 0 Active
Expand All @@ -43,9 +45,11 @@ myresourcegroup1 myiotdps2 westus myiotdps2.azure-devices-provisioning.net 4
List all Azure IoT Hub device provisioning services in a subscription.

### Example 2
```powershell
Get-AzIoTDeviceProvisioningService -ResourceGroupName "myresourcegroup"
```
PS C:\> Get-AzIoTDeviceProvisioningService -ResourceGroupName "myresourcegroup"

```output
ResourceGroupName Name Location ServiceOperationsHostName IotHubs AllocationPolicy Tags State
----------------- ---- -------- ------------------------- ------- ---------------- ---- -----
myresourcegroup myiotdps1 eastus myiotdps1.azure-devices-provisioning.net 1 Hashed 0 Active
Expand All @@ -55,9 +59,11 @@ myresourcegroup myiotdps2 westus myiotdps2.azure-devices-provisioning.net 4
List all Azure IoT Hub device provisioning services in the resource group 'myresourcegroup'.

### Example 3
```powershell
Get-AzIoTDeviceProvisioningService -ResourceGroupName "myresourcegroup" -Name "myiotdps"
```
PS C:\> Get-AzIoTDeviceProvisioningService -ResourceGroupName "myresourcegroup" -Name "myiotdps"

```output
ResourceGroupName : myresourcegroup
Name : myiotdps
Location : eastus
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
external help file: Microsoft.Azure.PowerShell.Cmdlets.DeviceProvisioningServices.dll-Help.xml
Module Name: Az.DeviceProvisioningServices
online version: https://docs.microsoft.com/powershell/module/az.deviceprovisioningservices/get-aziotdeviceprovisioningserviceaccesspolicy
Expand Down Expand Up @@ -36,9 +36,11 @@ For an introduction to Azure IoT Hub Device Provisioning Service, see https://do
## EXAMPLES

### Example 1
```powershell
Get-AzIoTDeviceProvisioningServiceAccessPolicy -ResourceGroupName "myresourcegroup" -Name "myiotdps"
```
PS C:\> Get-AzIoTDeviceProvisioningServiceAccessPolicy -ResourceGroupName "myresourcegroup" -Name "myiotdps"

```output
KeyName Rights
------- ------
mypolicy1 ServiceConfig, DeviceConnect, EnrollmentWrite
Expand All @@ -48,9 +50,11 @@ mypolicy2 EnrollmentWrite
List all shared access policies in "myiotdps".

### Example 2
```powershell
Get-AzIoTDeviceProvisioningServiceAccessPolicy -ResourceGroupName "myresourcegroup" -Name "myiotdps" -KeyName "mypolicy"
```
PS C:\> Get-AzIoTDeviceProvisioningServiceAccessPolicy -ResourceGroupName "myresourcegroup" -Name "myiotdps" -KeyName "mypolicy"

```output
ResourceGroupName : myresourcegroup
Name : myiotdps
KeyName : mypolicy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
external help file: Microsoft.Azure.PowerShell.Cmdlets.DeviceProvisioningServices.dll-Help.xml
Module Name: Az.DeviceProvisioningServices
online version: https://docs.microsoft.com/powershell/module/az.deviceprovisioningservices/get-aziotdeviceprovisioningservicecertificate
Expand Down Expand Up @@ -36,9 +36,11 @@ For a detailed explanation of CA certificates in Azure IoT Hub Device Provisioni
## EXAMPLES

### Example 1
```powershell
Get-AzIoTDeviceProvisioningServiceCertificate -ResourceGroupName "myresourcegroup" -Name "myiotdps" -CertificateName "mycertificate"
```
PS C:\> Get-AzIoTDeviceProvisioningServiceCertificate -ResourceGroupName "myresourcegroup" -Name "myiotdps" -CertificateName "mycertificate"

```output
Id : /subscriptions/377cxxxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Microsoft.Devices/provisioningServices/myiotdps/certificates/mycertificate
ResourceGroupName : myresourcegroup
Name : myiotdps
Expand All @@ -54,9 +56,11 @@ Etag : AAAAAAFpGcA=
Show details about "mycertificate" in an Azure IoT Hub device provisioning service.

### Example 2
```powershell
Get-AzIoTDps -ResourceGroupName "myresourcegroup" -Name "myiotdps" | Get-AzIoTDpsCertificate
```
PS C:\> Get-AzIoTDps -ResourceGroupName "myresourcegroup" -Name "myiotdps" | Get-AzIoTDpsCertificate

```output
ResourceGroupName Name CertificateName Status Expiry
----------------- ---- --------------- ------ ------
myresourcegroup myiotdps mycert1 Unverified 12/04/2027 13:12
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
external help file: Microsoft.Azure.PowerShell.Cmdlets.DeviceProvisioningServices.dll-Help.xml
Module Name: Az.DeviceProvisioningServices
online version: https://docs.microsoft.com/powershell/module/az.deviceprovisioningservices/get-aziotdeviceprovisioningserviceenrollment
Expand Down Expand Up @@ -37,14 +37,14 @@ Get device enrollment details or List device enrollments in an Azure IoT Hub Dev

### Example 1
```powershell
PS C:\> Get-AzIoTDeviceProvisioningServiceEnrollment -ResourceGroupName "myresourcegroup" -DpsName "mydps" -RegistrationId "enroll1"
Get-AzIoTDeviceProvisioningServiceEnrollment -ResourceGroupName "myresourcegroup" -DpsName "mydps" -RegistrationId "enroll1"
```

Get device enrollment details in an Azure IoT Hub Device Provisioning Service.

### Example 2
```powershell
PS C:\> Get-AzIoTDeviceProvisioningServiceEnrollment -ResourceGroupName "myresourcegroup" -DpsName "mydps"
Get-AzIoTDeviceProvisioningServiceEnrollment -ResourceGroupName "myresourcegroup" -DpsName "mydps"
```

List device enrollments in an Azure IoT Hub Device Provisioning Service.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
external help file: Microsoft.Azure.PowerShell.Cmdlets.DeviceProvisioningServices.dll-Help.xml
Module Name: Az.DeviceProvisioningServices
online version: https://docs.microsoft.com/powershell/module/az.deviceprovisioningservices/get-aziotdeviceprovisioningserviceenrollmentgroup
Expand Down Expand Up @@ -37,14 +37,14 @@ Get the details of an enrollment group or list all enrollment groups in an Azure

### Example 1
```powershell
PS C:\> Get-AzIoTDeviceProvisioningServiceEnrollmentGroup -ResourceGroupName "myresourcegroup" -DpsName "mydps" -Name "enroll1"
Get-AzIoTDeviceProvisioningServiceEnrollmentGroup -ResourceGroupName "myresourcegroup" -DpsName "mydps" -Name "enroll1"
```

Get device enrollment group in an Azure IoT Hub Device Provisioning Service.

### Example 2
```powershell
PS C:\> Get-AzIoTDeviceProvisioningServiceEnrollmentGroup -ResourceGroupName "myresourcegroup" -DpsName "mydps"
Get-AzIoTDeviceProvisioningServiceEnrollmentGroup -ResourceGroupName "myresourcegroup" -DpsName "mydps"
```

List all device enrollment groups in an Azure IoT Hub Device Provisioning Service.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
external help file: Microsoft.Azure.PowerShell.Cmdlets.DeviceProvisioningServices.dll-Help.xml
Module Name: Az.DeviceProvisioningServices
online version: https://docs.microsoft.com/powershell/module/az.deviceprovisioningservices/get-aziotdeviceprovisioningservicelinkedhub
Expand Down Expand Up @@ -36,9 +36,11 @@ For an introduction to Azure IoT Hub Device Provisioning Service, see https://do
## EXAMPLES

### Example 1
```powershell
Get-AzIoTDeviceProvisioningServiceLinkedHub -ResourceGroupName "myresourcegroup" -Name "myiotdps"
```
PS C:\> Get-AzIoTDeviceProvisioningServiceLinkedHub -ResourceGroupName "myresourcegroup" -Name "myiotdps"

```output
LinkedHubName Location AllocationWeight ApplyAllocationPolicy
------------- -------- ---------------- ---------------------
myiothub1.azure-devices.net eastus 2
Expand All @@ -48,9 +50,11 @@ myiothub2.azure-devices.net westus2 true
List all linked IoT hubs in "myiotdps".

### Example 2
```powershell
Get-AzIoTDpsHub -ResourceGroupName "myresourcegroup" -Name "myiotdps" -LinkedHubName "myiothub1"
```
PS C:\> Get-AzIoTDpsHub -ResourceGroupName "myresourcegroup" -Name "myiotdps" -LinkedHubName "myiothub1"

```output
ResourceGroupName : myresourcegroup
Name : myiotdps
LinkedHubName : myiothub1.azure-devices.net
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
external help file: Microsoft.Azure.PowerShell.Cmdlets.DeviceProvisioningServices.dll-Help.xml
Module Name: Az.DeviceProvisioningServices
online version: https://docs.microsoft.com/powershell/module/az.deviceprovisioningservices/get-aziotdeviceprovisioningserviceregistration
Expand Down Expand Up @@ -39,14 +39,14 @@ Get the device registration state or the registration state of devices under the

### Example 1
```powershell
PS C:\> Get-AzIoTDeviceProvisioningServiceRegistration -ResourceGroupName "myresourcegroup" -DpsName "mydps" -RegistrationId "enroll1"
Get-AzIoTDeviceProvisioningServiceRegistration -ResourceGroupName "myresourcegroup" -DpsName "mydps" -RegistrationId "enroll1"
```

Get the device registration state details in an Azure IoT Hub Device Provisioning Service.

### Example 2
```powershell
PS C:\> Get-AzIoTDeviceProvisioningServiceRegistration -ResourceGroupName "myresourcegroup" -DpsName "mydps" -EnrollmentId "grp-enroll1"
Get-AzIoTDeviceProvisioningServiceRegistration -ResourceGroupName "myresourcegroup" -DpsName "mydps" -EnrollmentId "grp-enroll1"
```

List all the registration state of devices in this enrollmentGroup.
Expand Down
Loading

0 comments on commit 3ff3183

Please sign in to comment.