Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.22k stars 3.83k forks source link

Get-AzureRole does not respect -ErrorAction #124

Closed carlocardella closed 8 years ago

carlocardella commented 9 years ago

In my subscription I have a number of cloud services, a few of them don't have a deployment (just empty services). If I try to collect info about the cloud service roles, even using -ErrorAction SilentlyContinue to not be blocked by the empty deployments, I still get a terminating error:

Get-AzureService | Get-AzureRole -ErrorAction SilentlyContinue

RoleName : EventSourceInfo.WebService InstanceCount : 2 DeploymentID : ServiceName : OperationDescription : Get-AzureRole OperationId : OperationStatus : Succeeded

Get-AzureRole : ResourceNotFound: No deployments were found. At line:1 char:20

Anyway if I use Get-AzureDeployment everything works as expected:

Get-AzureService | Get-AzureDeployment -ErrorAction SilentlyContinue | select DeploymentName

DeploymentName

deployment 1 deployment 2

singhkays commented 9 years ago

Thanks for the feedback @carlocardella I'll add this to the list of bugfixes