protected void ExecuteContainerServiceGetMethod(object[] invokeMethodInputParameters) { string resourceGroupName = (string)ParseParameter(invokeMethodInputParameters[0]); string containerServiceName = (string)ParseParameter(invokeMethodInputParameters[1]); if (!string.IsNullOrEmpty(resourceGroupName) && !string.IsNullOrEmpty(containerServiceName)) { var result = ContainerServiceClient.Get(resourceGroupName, containerServiceName); WriteObject(result); } else if (!string.IsNullOrEmpty(resourceGroupName)) { var result = ContainerServiceClient.List(resourceGroupName); WriteObject(result); } }
protected void ExecuteContainerServiceGetMethod(object[] invokeMethodInputParameters) { string resourceGroupName = (string)ParseParameter(invokeMethodInputParameters[0]); string containerServiceName = (string)ParseParameter(invokeMethodInputParameters[1]); if (!string.IsNullOrEmpty(resourceGroupName) && !string.IsNullOrEmpty(containerServiceName)) { var result = ContainerServiceClient.Get(resourceGroupName, containerServiceName); var psObject = new PSContainerService(); Mapper.Map <ContainerService, PSContainerService>(result, psObject); WriteObject(psObject); } else if (!string.IsNullOrEmpty(resourceGroupName)) { var result = ContainerServiceClient.List(resourceGroupName); var psObject = new List <PSContainerServiceList>(); foreach (var r in result) { psObject.Add(Mapper.Map <ContainerService, PSContainerServiceList>(r)); } WriteObject(psObject); } }