ErrorAction does not work with Get-AzureRmResource
I am trying to suppress error from Get-AzureRmResource however it is not taking effect with ErrorActionPreference.
Get-AzureRmResource -ResourceName "hiddenforsecurity" -ResourceType "Microsoft.Web/serverFarms" -ResourceGroupName "Howareyou" -ErrorAction SilentlyContinue Get-AzureRmResource : ResourceNotFound : The Resource 'Microsoft.Web/serverFarms/hiddenforsecurity' under resource group 'Howareyou' was not found. At line:1 char:8
- $new = Get-AzureRmResource -ResourceName hiddenforsecurity -ResourceType "Microsof ...
-
- CategoryInfo : CloseError: (:) [Get-AzureRmResource], ErrorResponseMessageException - FullyQualifiedErrorId : ResourceNotFound,Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.GetAzureResourceCmdlet
Thanks, Pradebban Raja
Looks to be the same issue as #1450, #1451, #1452
Lets look into supporting this.
@markcowl - I believe we need to consistently support this across cmdlets. It is not specific to ARM. Hence removing the ARM label and assigning it to your team. Please let me know if you feel otherwise.
@ravbhatnagar See https://github.com/Azure/azure-powershell/pull/2736/files This is resolved for cmdlets that use the AzurePSCmdlet override of ProcessRecord. Reassigning to you so you cna verify this is the case for ResourceManager cmdlets.
Any progress on this issue? I'm using Get-AzureRmResource cmdlet to check if AppInsights exists or not. Used $erroractionpreference='silentlycontinue' to suppress the error and it works perfectly on my machine. But when ran as a release definition task on VSTS hosted agent the erroractionpreference doesn't work and it is simply terminating the program. Please provide some work around for this.
Hi guys, I have the same error. Also, when I create a new db, there is a question that I must respond to continue.
How can I skip programmatically this prompt? Force is enough? Thanks
I believe this will be resolved in PR https://github.com/Azure/azure-powershell/pull/6008
The fix for this should be available on May 7th in version 6.0.0 of AzureRM (version 6.0.0 of AzureRM.Resources). Please re-open this issue if the problem persists.