Find-AzureRmResourceGroup

Searches for resource groups.

Syntax

Find-AzureRmResourceGroup
    [-Tag <Hashtable>]
    [-ApiVersion <String>]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

Description

The Find-AzureRmResourceGroup cmdlet searches for resource groups using the specified parameters.

Examples

Example 1: Find all resource groups

PS C:\>Find-AzureRmResourceGroup

This command finds all resource groups.

Example 2: Find resource groups by tag name

PS C:\>Find-AzureRmResourceGroup -Tag @{ "testtag" = $null }

This command finds all resource groups that have a tag named testtag.

Example 3: Find resource groups by tag name and value

PS C:\>Find-AzureRmResourceGroup -Tag @{"testtag" = "testval" }

This command finds all resource groups that have a tag named testtag and the value testval.

Optional Parameters

-ApiVersion

Specifies the version of the resource provider API to use. If you do not specify a version, this cmdlet uses the latest available version.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Pre

Indicates that this cmdlet considers pre-release API versions when it automatically determines which version to use.

Type:System.Management.Automation.SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Tag

Specifies tag information, as a hash table, to filter your results. Use the following formats:

@{tagName=$null} or @{tagName = 'tagValue'}.

Type:Hashtable
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Outputs

System.Management.Automation.PSObject