public override void ExecuteCmdlet() { if (this.IsParameterBound(c => c.ResourceId)) { var resourceIdentifier = new ResourceIdentifier(ResourceId); this.ClusterName = resourceIdentifier.ResourceName; this.ResourceGroupName = resourceIdentifier.ResourceGroupName; } if (this.IsParameterBound(c => c.InputObject)) { this.ClusterName = this.InputObject.Name; this.ResourceGroupName = this.InputObject.ResourceGroup; } if (ClusterName != null && ResourceGroupName == null) { ResourceGroupName = GetResourceGroupByAccountName(ClusterName); } var result = HDInsightManagementClient.GetHosts(ResourceGroupName, ClusterName) .Select(entry => new AzureHDInsightHostInfo(entry)).ToList(); WriteObject(result, true); }