Disable-AzAdvisorRecommendation

Disable an Azure Advisor recommendation.

Syntax

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

Description

Disable an Azure Advisor recommendation.

Examples

Example 1: Disable recommendation by recommendation name

Disable-AzAdvisorRecommendation -RecommendationName 42963553-61de-5334-2d2e-47f3a0099d41 -Day 1

SuppressionId                        Name                     Resource Group   Ttl
-------------                        ----                     --------------   ---
5b931ff3-42a3-5f80-797f-8e018a6dfaf5 HardcodedSuppressionName automanagehcrprg 1.00:00:00

Disable recommendation by recommendation name

Example 2: Disable recommendation by recommendation resource id

Disable-AzAdvisorRecommendation -ResourceId /subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/automanagehcrprg/providers/microsoft.compute/virtualmachines/arcbox-capi-mgmt/providers/Microsoft.Advisor/recommendations/42963553-61de-5334-2d2e-47f3a0099d41 -Day 1

SuppressionId                        Name                     Resource Group   Ttl
-------------                        ----                     --------------   ---
5b931ff3-42a3-5f80-797f-8e018a6dfaf5 HardcodedSuppressionName automanagehcrprg 1.00:00:00

Disable recommendation by recommendation resource id

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

-Day

Days to disable.

Type:Object
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