Editar

Compartir a través de


Enable-AzAdvisorRecommendation

Enables Azure Advisor recommendation(s).

Syntax

Enable-AzAdvisorRecommendation
      -ResourceId <String>
      [-SubscriptionId <String[]>]
      [-DefaultProfile <PSObject>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Enable-AzAdvisorRecommendation
      [-SubscriptionId <String[]>]
      -RecommendationName <String>
      [-DefaultProfile <PSObject>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Enable-AzAdvisorRecommendation
      [-SubscriptionId <String[]>]
      -InputObject <IAdvisorIdentity>
      [-DefaultProfile <PSObject>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

Enables Azure Advisor recommendation(s).

Examples

Example 1: Enable recommendation by resource Id

Enable-AzAdvisorRecommendation -ResourceId /subscriptions/a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1/resourcegroups/automanagehcrprg/providers/microsoft.compute/virtualmachines/arcbox-capi-mgmt/providers/Microsoft.Advisor/recommendations/b1b1b1b1-cccc-dddd-eeee-f2f2f2f2f2f2

Name                                 Category Resource Group   Impact ImpactedField
----                                 -------- --------------   ------ -------------
b1b1b1b1-cccc-dddd-eeee-f2f2f2f2f2f2 Security automanagehcrprg High   Microsoft.Compute/virtualMachines

Enable recommendation by resource Id

Example 2: Enable recommendation byrecommendation name

Enable-AzAdvisorRecommendation -RecommendationName b1b1b1b1-cccc-dddd-eeee-f2f2f2f2f2f2

Name                                 Category Resource Group   Impact ImpactedField
----                                 -------- --------------   ------ -------------
b1b1b1b1-cccc-dddd-eeee-f2f2f2f2f2f2 Security automanagehcrprg High   Microsoft.Compute/virtualMachines

Enable recommendation byrecommendation name

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:PSObject
Aliases:AzureRMContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

The powershell object type PsAzureAdvisorResourceRecommendationBase returned by Get-AzAdvisorRecommendation call. To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

Type:IAdvisorIdentity
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-RecommendationName

ResourceName of the recommendation.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceId

Id of the recommendation to be suppressed.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SubscriptionId

The Azure subscription ID.

Type:String[]
Position:Named
Default value:(Get-AzContext).Subscription.Id
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

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

Inputs

IAdvisorIdentity

Outputs

IResourceRecommendationBase