2017-01-31 11 views
1

最近Azure PowershellモジュールをAzure Automationアカウントで更新しました。新しいバージョンの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という名前のタグのリソースグループを取得する必要があります。

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

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

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

注:確認済みのAzureRm.Resourcesモジュールで作業Find-AzureRmResourceGroupコマンドレットのタグ名で検索リソースグループ(複数可)の例から得られる

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

バージョン:3.5.0

関連する問題