Find-AzureRmResource

Searches for resources based on specified parameters.

Syntax

Find-AzureRmResource
    [-ApiVersion <String>]
    [-ExpandProperties]
    [-ExtensionResourceType <String>]
    [-InformationAction <ActionPreference>]
    [-InformationVariable <String>]
    [-ODataQuery <String>]
    [-Pre]
    [-ResourceGroupNameContains <String>]
    [-ResourceGroupNameEquals <String>]
    [-ResourceNameContains <String>]
    [-ResourceNameEquals <String>]
    [-ResourceType <String>]
    [-Top <Int32>]
    [<CommonParameters>]
Find-AzureRmResource
    [-ApiVersion <String>]
    [-ExpandProperties]
    [-ExtensionResourceType <String>]
    [-InformationAction <ActionPreference>]
    [-InformationVariable <String>]
    [-ODataQuery <String>]
    [-Pre]
    [-ResourceNameContains <String>]
    [-ResourceNameEquals <String>]
    -ResourceType <String>
    [-TenantLevel]
    [-Top <Int32>]
    [<CommonParameters>]
Find-AzureRmResource
    [-ApiVersion <String>]
    [-ExpandProperties]
    [-ExtensionResourceType <String>]
    [-InformationAction <ActionPreference>]
    [-InformationVariable <String>]
    [-ODataQuery <String>]
    [-Pre]
    [-ResourceGroupNameContains <String>]
    [-ResourceGroupNameEquals <String>]
    [-ResourceNameContains <String>]
    [-ResourceNameEquals <String>]
    -ResourceType <String>
    [-Top <Int32>]
    [<CommonParameters>]
Find-AzureRmResource
    [-ApiVersion <String>]
    [-ExpandProperties]
    [-InformationAction <ActionPreference>]
    [-InformationVariable <String>]
    [-ODataQuery <String>]
    [-Pre]
    [-Tag <Hashtable>]
    [-Top <Int32>]
    [<CommonParameters>]
Find-AzureRmResource
    [-ApiVersion <String>]
    [-ExpandProperties]
    [-InformationAction <ActionPreference>]
    [-InformationVariable <String>]
    [-ODataQuery <String>]
    [-Pre]
    [-TagName <String>]
    [-TagValue <String>]
    [-Top <Int32>]
    [<CommonParameters>]

Description

The Find-AzureRmResource cmdlet searches for resources based on specified parameters.

Examples

Example 1: Search for resources by type and resource group name

PS C:\>Find-AzureRmResource -ResourceType "microsoft.web/sites" -ResourceGroupNameContains "ResourceGroup"

This command searches for resources of the type microsoft.web/sites under resource groups that have names that match the string ResourceGroup.

Example 2: Search for resources by type and resource name

PS C:\>Find-AzureRmResource -ResourceType "microsoft.web/sites" -ResourceNameContains "test"

This command searches for resources of the type microsoft.web/sites that have a resource name that matches the string test.

Required Parameters

-TenantLevel

Indicates that this cmdlet operates at the tenant level.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

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
-ExpandProperties

Indicates that this cmdlet expands the properties of the resource.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ExtensionResourceType

Specifies the extension resource type for the resources for which this cmdlet searches. For instance:

Microsoft.Sql/Servers/Databases

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

Specifies how this cmdlet responds to an information event.

The acceptable values for this parameter are:

  • Continue
  • Ignore
  • Inquire
  • SilentlyContinue
  • Stop
  • Suspend
Type:ActionPreference
Aliases:infa
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InformationVariable

Specifies an information variable.

Type:String
Aliases:iv
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ODataQuery

Specifies an Open Data Protocol (OData) style filter. This cmdlet appends this value to the request in addition to any other filters.

Type:String
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:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ResourceGroupNameContains

Specifies a partial name of a resource group. This cmdlet matches resource groups of which this value is a substring. The cmdlet searches for resources in those resource groups.

Type:String
Aliases:ResourceGroupName
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ResourceGroupNameEquals

The resource group name for a full match.

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

Specifies a partial name of a resource. The cmdlet searches for resources which contain this value as a substring.

Type:String
Aliases:Name
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ResourceNameEquals

The resource name for a full match. e.g. if your resource name is testResource, you can specify testResource.

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

Specifies the type of a resource. For instance, for a database, the resource type is as follows:

Microsoft.Sql/Servers/Databases

This cmdlet searches for resources of the specified type.

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

The tag filter for the OData query. The expected format is @{tagName=$null} or @{tagName = 'tagValue'}.

Type:Hashtable
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-TagName
Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-TagValue
Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Top

Specifies the number of resources to retrieve.

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Outputs

System.Management.Automation.PSObject