2017-01-31 14 views
1

최근에 Azure Automation 계정에서 Azure Powershell 모듈을 업데이트합니다. 새 버전의 AzureRm.Resources 모듈에서 리소스 및 리소스 그룹 변경에 대한 태그 처리 방법이있는 것으로 보입니다.태그 이름으로 Azure 리소스 그룹 찾기

Find-AzureRmResourceGroup -Tag @{Name="AutoShutDownSchedule"} 

을하지만이 아무것도 반환하지 않습니다 이전이 내가 지금은 사용할 필요가 https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-using-tags에 따라 AutoShutdownSchedule 태그 이름

(Get-AzureRmResourceGroup | where {$_.Tags.Name -contains "AutoShutdownSchedule"} 

과 자원 그룹을 나열 할 방법이다. 그러나 Find-AzureRmResourceGroup이 작동 중입니다.

Find-AzureRmResourceGroup 


id   : /subscriptions/xxxxx/resourceGroups/HaaS-CDH-Starter-Spotfire-1393 
name  : xxxxx 
location : eastus2 
tags  : @{AutoShutdownSchedule=18:00} 
properties : @{provisioningState=Succeeded} 

id   : /subscriptions/xxxxxx/resourceGroups/mnt-dev-us 
name  : xxxx 
location : eastus2 
tags  : @{AutoShutdownSchedule=18:00} 
properties : @{provisioningState=Succeeded} 

내가 뭘 잘못하고있는 걸까요?

+0

내 대답이 귀하의 질문을 해결하는 데 도움이되고 도움을 주셔서 감사하는 마음으로 대답을 대답으로 표시하십시오. – juvchan

답변

1

AutoShutdownSchedule의 태그에 대한 자원 그룹을 가져 오려면 다음 명령을 사용해야합니다.

Find-AzureRmResourceGroup -Tag @{ AutoShutdownSchedule = $null } 

Find-AzureRmResourceGroup cmdlet에 대한 태그 이름으로 리소스 그룹 (들)을 찾기의 예에서 얻을 수 있습니다 :

get-help Find-AzureRmResourceGroup -full 
-------------------------- FindByTagName -------------------------- 

Find-AzureRmResourceGroup -Tag @{ testtag = $null } 

Finds all resource group with a tag with name 'testtag'. 

참고 : 검증 AzureRm.Resources 모듈 작업 버전 : 3.5.0