Skip to content

Commit bd36884

Browse files
Get-AzVmSize deprecation (#27109)
1 parent 2b6b156 commit bd36884

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

src/Compute/Compute/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
2121
-->
2222
## Upcoming Release
23+
* Added breaking change message for `Get-AzVMSize`.
2324

2425
## Version 9.1.0
2526
* Added new parameter `EncryptionIdentity` to cmdlet `Set-AzVmssDiskEncryptionExtension`

src/Compute/Compute/VirtualMachineSizes/GetAzureVMSizeCommand.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@
1818
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
1919
using Microsoft.Azure.Management.Compute.Models;
2020
using Microsoft.Rest.Azure;
21+
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
2122
using System.Collections.Generic;
2223
using System.Management.Automation;
2324

2425
namespace Microsoft.Azure.Commands.Compute
2526
{
27+
[GenericBreakingChangeWithVersion("The \"ListVirtualMachineSize\" parameter set will be deprecated as its API: \"Virtual Machine Sizes - List\" is deprecated. For listing available VM sizes by subscription or location, please use instead \"Get-AzComputeResourceSku\". Other parameter sets: \"List Available Sizes for Availability Set\" and \"List Available Sizes for Virtual Machine\" will continue to be supported.", "14.0.0", "10.0.0")]
2628
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "VMSize", DefaultParameterSetName = ListVirtualMachineSizeParamSet)]
2729
[OutputType(typeof(PSVirtualMachineSize))]
2830
public class GetAzureVMSizeCommand : VirtualMachineSizeBaseCmdlet

src/Compute/Compute/help/Get-AzVMSize.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ schema: 2.0.0
1111
## SYNOPSIS
1212
Gets available virtual machine sizes.
1313

14+
**Note**: The **List Virtual Machine Size** parameter set will be deprecated in the next major release (14.0.0) as its API: [Virtual Machine Sizes - List](https://learn.microsoft.com/en-us/rest/api/compute/virtual-machine-sizes/list) is deprecated. For listing available VM sizes by subscription or location, please use instead [Get-AzComputeResourceSku](https://learn.microsoft.com/en-us/powershell/module/az.compute/get-azcomputeresourcesku). Other parameter sets: "List Available Sizes for Availability Set" and "List Available Sizes for Virtual Machine" will continue to be supported.
15+
1416
## SYNTAX
1517

1618
### ListVirtualMachineSizeParamSet (Default)
@@ -34,6 +36,8 @@ Get-AzVMSize [-ResourceGroupName] <String> [-VMName] <String> [-DefaultProfile <
3436
## DESCRIPTION
3537
The **Get-AzVMSize** cmdlet gets available virtual machine sizes.
3638

39+
**Note**: The **List Virtual Machine Size** parameter set will be deprecated in the next major release (14.0.0) as its API: [Virtual Machine Sizes - List](https://learn.microsoft.com/en-us/rest/api/compute/virtual-machine-sizes/list) is deprecated. For listing available VM sizes by subscription or location, please use instead [Get-AzComputeResourceSku](https://learn.microsoft.com/en-us/powershell/module/az.compute/get-azcomputeresourcesku). Other parameter sets: "List Available Sizes for Availability Set" and "List Available Sizes for Virtual Machine" will continue to be supported.
40+
3741
## EXAMPLES
3842

3943
### Example 1: Get virtual machine sizes for a location
@@ -43,6 +47,8 @@ Get-AzVMSize -Location "Central US"
4347

4448
This command gets the available sizes for virtual machines in the specified location.
4549

50+
**Note**: This parameter set will be deprecated in the next major release.
51+
4652
### Example 2: Get sizes for an availability set
4753
```powershell
4854
Get-AzVMSize -ResourceGroupName "ResourceGroup03" -AvailabilitySetName "AvailabilitySet17"

0 commit comments

Comments
 (0)