File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
src/ResourceManager/Compute/Commands.Compute/Extension/SqlServer Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 18
18
using Microsoft . Azure . Management . Compute . Models ;
19
19
using Newtonsoft . Json ;
20
20
using System . Management . Automation ;
21
+ using System . Linq ;
21
22
22
23
namespace Microsoft . Azure . Commands . Compute
23
24
{
@@ -28,8 +29,8 @@ namespace Microsoft.Azure.Commands.Compute
28
29
public class SetAzureSqlServerExtensionCommand : VirtualMachineExtensionBaseCmdlet
29
30
{
30
31
/// <summary>
31
- /// The specific version of the SqlServer extension that Set-AzureRmVMSqlServerExtension will
32
- /// apply the settings to.
32
+ /// The specific version of the SqlServer extension that Set-AzureRmVMSqlServerExtension will
33
+ /// apply the settings to.
33
34
/// </summary>
34
35
[ Alias ( "HandlerVersion" ) ]
35
36
[ Parameter (
@@ -106,6 +107,16 @@ public override void ExecuteCmdlet()
106
107
ProtectedSettings = this . GetPrivateConfiguration ( ) ,
107
108
} ;
108
109
110
+ VirtualMachine vm = ComputeClient . ComputeManagementClient . VirtualMachines . Get ( this . ResourceGroupName , this . VMName ) ;
111
+ if ( vm != null )
112
+ {
113
+ VirtualMachineExtension extension = vm . Resources . Where ( x => x . Publisher . Equals ( parameters . Publisher ) ) . FirstOrDefault ( ) ;
114
+ if ( extension != null )
115
+ {
116
+ this . Name = extension . Name ;
117
+ }
118
+ }
119
+
109
120
// Add retry logic due to CRP service restart known issue CRP bug: 3564713
110
121
// Similair approach taken in DSC cmdlet as well
111
122
var count = 1 ;
You can’t perform that action at this time.
0 commit comments