Skip to content

Commit f50eca8

Browse files
unknownunknown
authored andcommitted
Add warning for New-AzureVM Name deprication.
1 parent d12bbe4 commit f50eca8

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

src/ResourceManager/Compute/Commands.Compute/Properties/Resources.Designer.cs

Lines changed: 16 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ResourceManager/Compute/Commands.Compute/Properties/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@
135135
<data name="DeprecationOfGetAzureVMImageDetail" xml:space="preserve">
136136
<value>Get-AzureVMImageDetail cmdlet will be deprecated in a future release of Azure PowerShell. The functionality is merged into Get-AzureVMImage cmdlet.</value>
137137
</data>
138+
<data name="DeprecationOfNewAzureVMNameParameterWarning" xml:space="preserve">
139+
<value>The Name parameter of New-AzureVM cmdlet will be deprecated in a future release of Azure PowerShell, because the functionality of Name parameter is obsolete.</value>
140+
</data>
138141
<data name="VirtualMachineExtensionRemovalCaption" xml:space="preserve">
139142
<value>Virtual machine extension removal operation</value>
140143
</data>

src/ResourceManager/Compute/Commands.Compute/VirtualMachine/Operation/NewAzureVMCommand.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ public override void ExecuteCmdlet()
5050
{
5151
base.ExecuteCmdlet();
5252

53+
if (! string.IsNullOrEmpty(this.Name))
54+
{
55+
WriteWarning(Properties.Resources.DeprecationOfGetAzureVMImageDetail);
56+
}
57+
5358
var parameters = new VirtualMachine
5459
{
5560
HardwareProfile = this.VM.HardwareProfile,

0 commit comments

Comments
 (0)