public override void ExecuteCmdlet() { IotHubDescription iotHubDescription; if (ParameterSetName.Equals(InputObjectParameterSet)) { this.ResourceGroupName = this.InputObject.Resourcegroup; this.IotHubName = this.InputObject.Name; iotHubDescription = IotHubUtils.ConvertObject <PSIotHub, IotHubDescription>(this.InputObject); } else { if (ParameterSetName.Equals(ResourceIdParameterSet)) { this.ResourceGroupName = IotHubUtils.GetResourceGroupName(this.ResourceId); this.IotHubName = IotHubUtils.GetIotHubName(this.ResourceId); } iotHubDescription = this.IotHubClient.IotHubResource.Get(this.ResourceGroupName, this.IotHubName); } IEnumerable <SharedAccessSignatureAuthorizationRule> authPolicies = this.IotHubClient.IotHubResource.ListKeys(this.ResourceGroupName, this.IotHubName); SharedAccessSignatureAuthorizationRule policy = IotHubUtils.GetPolicy(authPolicies, PSAccessRights.RegistryWrite); PSIotHubConnectionString psIotHubConnectionString = IotHubUtils.ToPSIotHubConnectionString(policy, iotHubDescription.Properties.HostName); RegistryManager registryManager = RegistryManager.CreateFromConnectionString(psIotHubConnectionString.PrimaryConnectionString); if (this.Name != null) { this.WriteObject(IotHubDataPlaneUtils.ToPSDeployment(registryManager.GetConfigurationAsync(this.Name).GetAwaiter().GetResult())); } else { this.WriteObject(IotHubDataPlaneUtils.ToPSDeployments(registryManager.GetConfigurationsAsync(Int32.MaxValue).GetAwaiter().GetResult()), true); } }