[DeviceProvisioningService] Manage Azure IoT Hub Device Provisioning Service registrations.#11979
[DeviceProvisioningService] Manage Azure IoT Hub Device Provisioning Service registrations.#11979VeryEarly merged 3 commits intoAzure:masterfrom
Conversation
| } | ||
|
|
||
| public class PSDeviceRegistrationStates : PSDeviceRegistrationState | ||
| { } |
There was a problem hiding this comment.
Why is this PSDeviceRegistrationStates neede?
There was a problem hiding this comment.
The command will return either a single object or multiple objects, So having different output types is required to mention in .ps1xml format file to display the output of multiple objects in table format and single object in list format.
PSDeviceRegistrationStates: Use to display the output in table format
PSDeviceRegistrationState: Use to display the output in list format
| { | ||
| string query = this.IsParameterBound(c => c.Query) ? this.Query : "select * from enrollments"; | ||
| QueryResult results = client.CreateEnrollmentGroupRegistrationStateQuery(new QuerySpecification(query), this.EnrollmentId).NextAsync().GetAwaiter().GetResult(); | ||
| this.WriteObject(IotDpsUtils.ToPSDeviceRegistrationStates(results.Items), true); |
There was a problem hiding this comment.
Can you please explain why not return PSDeviceRegistrationState?
There was a problem hiding this comment.
This section will return multiple items of Registration
|
|
||
| [Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IoTDeviceProvisioningServiceRegistration", DefaultParameterSetName = ResourceParameterSet)] | ||
| [Alias("Get-" + ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IoTDpsRegistration")] | ||
| [OutputType(typeof(PSDeviceRegistrationState), typeof(PSDeviceRegistrationStates[]))] |
There was a problem hiding this comment.
It looks like it's not necessary to have two output types
There was a problem hiding this comment.
This is only to display the output in different format
Description
Checklist
CONTRIBUTING.mdChangeLog.mdfile(s) has been updated:ChangeLog.mdfile can be found atsrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md## Upcoming Releaseheader -- no new version header should be added