Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/Advisor/Advisor.Autorest/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - Advisor")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("2.1.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("2.1.0")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("2.1.1")]
[assembly: System.Reflection.AssemblyVersionAttribute("2.1.1")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]

33 changes: 5 additions & 28 deletions src/Advisor/Advisor.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,15 @@ module-version: 0.1.0
# Normally, title is the service name
title: Advisor
subject-prefix: $(service-name)
resourcegroup-append: true

# If there are post APIs for some kinds of actions in the RP, you may need to
# uncomment following line to support viaIdentity for these post APIs
# identity-correction-for-post: true

# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
use-extension:
"@autorest/powershell": "3.x"

directive:
# Following is two common directive which are normally required in all the RPs
# 1. Remove the unexpanded parameter set
# 2. For New-* cmdlets, ViaIdentity is not required, so CreateViaIdentityExpanded is removed as well
- where:
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
variant: ^(Create|Update)(?!.*?Expanded)
Copy link

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regex pattern ^(Create|Update)(?!.*?Expanded) uses a negative lookahead that may not work as intended. Consider using ^Create$|^CreateViaIdentity$|^Update$|^UpdateViaIdentity$ for clearer intent and better maintainability.

Suggested change
variant: ^(Create|Update)(?!.*?Expanded)
variant: ^Create$|^Update$

Copilot uses AI. Check for mistakes.
remove: true
# Remove ViaIdentity parameter set for New-* cmdlets
- where:
variant: ^CreateViaIdentity$|^CreateViaIdentityExpanded$
remove: true
# Remove the set-* cmdlet
- where:
verb: Set
remove: true
Expand Down Expand Up @@ -117,18 +108,4 @@ directive:
- Ttl
labels:
ResourceGroupName: Resource Group

- where:
verb: Get
subject: Configuration
set:
breaking-change:
deprecated-output-properties:
- Digest
new-output-properties:
- Digest
change-description: The type of property 'Digest' of type 'Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IConfigData' has changed from 'Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IDigestConfig' to 'System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IDigestConfig]'.
deprecated-by-version: 9.0.0
deprecated-by-azversion: 15.0.0
change-effective-date: 2025/11/03
```
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ Disable an Azure Advisor recommendation.
https://learn.microsoft.com/powershell/module/az.advisor/Disable-AzAdvisorRecommendation
#>
function Disable-AzAdvisorRecommendation{
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IResourceRecommendationBase])]
[Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.OutputBreakingChangeAttribute("Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IResourceRecommendationBase", "15.0.0", "9.0.0", "2025/11/03", ReplacementCmdletOutputType = "Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IResourceRecommendationBase", DeprecatedOutputProperties = ("Action Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IRecommendationPropertiesActionsItem[]", "SuppressionId System.String[]"), NewOutputProperties = ("Action System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IRecommendationPropertiesActionsItem].", "SuppressionId System.Collections.Generic.List`1[System.String]"))]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IResourceRecommendationBase])]
[CmdletBinding(DefaultParameterSetName='IdParameterSet', SupportsShouldProcess, PositionalBinding=$false)]
param(
[Parameter(ParameterSetName='IdParameterSet', Mandatory, HelpMessage='Id of the recommendation to be suppressed.')]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ Enables Azure Advisor recommendation(s).
https://learn.microsoft.com/powershell/module/az.advisor/Enable-AzAdvisorRecommendation
#>
function Enable-AzAdvisorRecommendation{
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IResourceRecommendationBase])]
[Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.OutputBreakingChangeAttribute("Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IResourceRecommendationBase", "15.0.0", "9.0.0", "2025/11/03", ReplacementCmdletOutputType = "Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IResourceRecommendationBase", DeprecatedOutputProperties = ("Action Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IRecommendationPropertiesActionsItem[]", "SuppressionId System.String[]"), NewOutputProperties = ("Action System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IRecommendationPropertiesActionsItem].", "SuppressionId System.Collections.Generic.List`1[System.String]"))]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IResourceRecommendationBase])]
[CmdletBinding(DefaultParameterSetName='IdParameterSet', SupportsShouldProcess, PositionalBinding=$false)]
param(
[Parameter(ParameterSetName='IdParameterSet', Mandatory, HelpMessage='Id of the recommendation to be suppressed.')]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ Obtains details of a cached recommendation.
https://learn.microsoft.com/powershell/module/az.advisor/Get-AzAdvisorRecommendation
#>
function Get-AzAdvisorRecommendation {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IResourceRecommendationBase])]
[Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.OutputBreakingChangeAttribute("Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IResourceRecommendationBase", "15.0.0", "9.0.0", "2025/11/03", ReplacementCmdletOutputType = "Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IResourceRecommendationBase", DeprecatedOutputProperties = ("Action Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IRecommendationPropertiesActionsItem[]", "SuppressionId System.String[]"), NewOutputProperties = ("Action System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IRecommendationPropertiesActionsItem].", "SuppressionId System.Collections.Generic.List`1[System.String]"))]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IResourceRecommendationBase])]
[CmdletBinding(DefaultParameterSetName='ListByFilter', PositionalBinding=$false)]
param(
[Parameter(ParameterSetName='ListByName', Mandatory)]
Expand Down Expand Up @@ -150,4 +149,4 @@ function Get-AzAdvisorRecommendation {
if ($filter) {$PSBoundParameters['Filter'] = $filter}
. Az.Advisor.internal\Get-AzAdvisorRecommendation @PSBoundParameters
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ Updates or creates the Azure Advisor Configuration.
https://learn.microsoft.com/powershell/module/az.advisor/Set-AzAdvisorConfiguration
#>
function Set-AzAdvisorConfiguration {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IConfigData])]
[Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.OutputBreakingChangeAttribute("Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IConfigData", "15.0.0", "9.0.0", "2025/11/03", ReplacementCmdletOutputType = "Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IConfigData", DeprecatedOutputProperties = ("Digest Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IDigestConfig"), NewOutputProperties = ("Digest System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IDigestConfig]"))]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IConfigData])]
[CmdletBinding(DefaultParameterSetName='CreateByLCT', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(ParameterSetName='CreateByRG', Mandatory)]
Expand Down Expand Up @@ -58,9 +57,9 @@ function Set-AzAdvisorConfiguration {

[Parameter(ParameterSetName='CreateByLCT')]
[Parameter(ParameterSetName='CreateByInputObject')]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Support.CpuThreshold])]
[Microsoft.Azure.PowerShell.Cmdlets.Advisor.PSArgumentCompleterAttribute("5", "10", "15", "20")]
[Microsoft.Azure.PowerShell.Cmdlets.Advisor.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Advisor.Support.CpuThreshold]
[System.String]
# Minimum percentage threshold for Advisor low CPU utilization evaluation.
# Valid only for subscriptions.
# Valid values: 5 (default), 10, 15 or 20.
Expand Down
2 changes: 1 addition & 1 deletion src/Advisor/Advisor.Autorest/docs/Az.Advisor.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
Module Name: Az.Advisor
Module Guid: 277cf89e-e0e9-4a1a-8ded-b25839569c34
Module Guid: a246e719-1233-44b6-ad7b-e0cf5451c104
Download Help Link: https://learn.microsoft.com/powershell/module/az.advisor
Help Version: 1.0.0.0
Locale: en-US
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ 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.

```yaml
Type: Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IAdvisorIdentity
Expand Down Expand Up @@ -194,7 +193,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IResourceRecommendationBase
### Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IResourceRecommendationBase

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ 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.

```yaml
Type: Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IAdvisorIdentity
Expand Down Expand Up @@ -179,7 +178,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IResourceRecommendationBase
### Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IResourceRecommendationBase

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IConfigData
### Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IConfigData

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Obtains details of a cached recommendation.

### Example 1: List Recommendation by subscriptionId and resource group name
```powershell
Get-AzAdvisorRecommendation -ResourceGroupName lnxtest -Category HighAvailability
Get-AzAdvisorRecommendation -ResourceGroupName lnxtest -Category HighAvailability
```

```output
Expand Down Expand Up @@ -239,7 +239,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IResourceRecommendationBase
### Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IResourceRecommendationBase

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ Updates or creates the Azure Advisor Configuration.

### CreateByLCT (Default)
```
Set-AzAdvisorConfiguration [-SubscriptionId <String>] [-Exclude] [-LowCpuThreshold <CpuThreshold>]
Set-AzAdvisorConfiguration [-SubscriptionId <String>] [-Exclude] [-LowCpuThreshold <String>]
[-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
```

### CreateByInputObject
```
Set-AzAdvisorConfiguration -InputObject <IAdvisorIdentity> [-Exclude] [-LowCpuThreshold <CpuThreshold>]
Set-AzAdvisorConfiguration -InputObject <IAdvisorIdentity> [-Exclude] [-LowCpuThreshold <String>]
[-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
```

Expand Down Expand Up @@ -116,7 +116,7 @@ Valid only for subscriptions.
Valid values: 5 (default), 10, 15 or 20.

```yaml
Type: Microsoft.Azure.PowerShell.Cmdlets.Advisor.Support.CpuThreshold
Type: System.String
Parameter Sets: CreateByInputObject, CreateByLCT
Aliases:

Expand Down Expand Up @@ -197,7 +197,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IConfigData
### Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IConfigData

## NOTES

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Example 1: List Recommendation by subscriptionId and resource group name
```powershell
Get-AzAdvisorRecommendation -ResourceGroupName lnxtest -Category HighAvailability
Get-AzAdvisorRecommendation -ResourceGroupName lnxtest -Category HighAvailability
```

```output
Expand Down
2 changes: 1 addition & 1 deletion src/Advisor/Advisor.Autorest/generate-info.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"generate_Id": "faee0227-0eba-4ed3-a077-ed0edaf2610f"
"generate_Id": "1ccf0044-c18b-4489-b1da-75cfd3396fcb"
}
Loading