Skip to content

Commit 2b18858

Browse files
committed
Fix forceRerun parameter to accept any string.
1 parent 2a880dd commit 2b18858

File tree

7 files changed

+12
-8
lines changed

7 files changed

+12
-8
lines changed

src/ResourceManager/Compute/Commands.Compute.Test/Commands.Compute.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.2.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
6565
</Reference>
6666
<Reference Include="Microsoft.Azure.Management.Compute, Version=10.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
67-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Compute.12.0.0-prerelease\lib\net45\Microsoft.Azure.Management.Compute.dll</HintPath>
67+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Compute.12.0.1-prerelease\lib\net45\Microsoft.Azure.Management.Compute.dll</HintPath>
6868
<Private>True</Private>
6969
</Reference>
7070
<Reference Include="Microsoft.Azure.Management.Network, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">

src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineExtensionTests.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1382,7 +1382,10 @@ function Test-VirtualMachineExtensionWithSwitch
13821382
# Set extension settings by raw strings
13831383
$settingstr = '{"fileUris":[],"commandToExecute":""}';
13841384
$protectedsettingstr = '{"storageAccountName":"' + $stoname + '","storageAccountKey":"' + $stokey + '"}';
1385-
Set-AzureRmVMExtension -ResourceGroupName $rgname -Location $loc -VMName $vmname -Name $extname -Publisher $publisher -ExtensionType $exttype -TypeHandlerVersion $extver -SettingString $settingstr -ProtectedSettingString $protectedsettingstr -DisableAutoUpgradeMinorVersion -ForceRerun
1385+
Set-AzureRmVMExtension -ResourceGroupName $rgname -Location $loc -VMName $vmname `
1386+
-Name $extname -Publisher $publisher `
1387+
-ExtensionType $exttype -TypeHandlerVersion $extver -SettingString $settingstr -ProtectedSettingString $protectedsettingstr `
1388+
-DisableAutoUpgradeMinorVersion -ForceRerun "RerunExtension";
13861389

13871390
# Get VM Extension
13881391
$ext = Get-AzureRmVMExtension -ResourceGroupName $rgname -VMName $vmname -Name $extname;

src/ResourceManager/Compute/Commands.Compute.Test/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<package id="Microsoft.Azure.Gallery" version="2.6.2-preview" targetFramework="net45" />
77
<package id="Microsoft.Azure.Graph.RBAC" version="1.9.0-preview" targetFramework="net45" />
88
<package id="Microsoft.Azure.Management.Authorization" version="1.0.0" targetFramework="net45" />
9-
<package id="Microsoft.Azure.Management.Compute" version="12.0.0-prerelease" targetFramework="net45" />
9+
<package id="Microsoft.Azure.Management.Compute" version="12.0.1-prerelease" targetFramework="net45" />
1010
<package id="Microsoft.Azure.Management.Network" version="3.3.0-preview" targetFramework="net45" />
1111
<package id="Microsoft.Azure.Management.Storage" version="3.0.0" targetFramework="net45" />
1212
<package id="Microsoft.Azure.Test.Framework" version="1.0.5896.19355-prerelease" targetFramework="net45" />

src/ResourceManager/Compute/Commands.Compute/Commands.Compute.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
<Private>True</Private>
7878
</Reference>
7979
<Reference Include="Microsoft.Azure.Management.Compute, Version=10.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
80-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Compute.12.0.0-prerelease\lib\net45\Microsoft.Azure.Management.Compute.dll</HintPath>
80+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Compute.12.0.1-prerelease\lib\net45\Microsoft.Azure.Management.Compute.dll</HintPath>
8181
<Private>True</Private>
8282
</Reference>
8383
<Reference Include="Microsoft.Azure.Management.Network, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">

src/ResourceManager/Compute/Commands.Compute/Extension/SetAzureVMExtensionCommand.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ public class SetAzureVMExtensionCommand : VirtualMachineExtensionBaseCmdlet
134134
Mandatory = false,
135135
ValueFromPipelineByPropertyName = true,
136136
HelpMessage = "Force re-run even if extension configuration has not changed")]
137-
public SwitchParameter ForceRerun { get; set; }
137+
[ValidateNotNullOrEmpty]
138+
public string ForceRerun { get; set; }
138139

139140
public override void ExecuteCmdlet()
140141
{
@@ -161,7 +162,7 @@ public override void ExecuteCmdlet()
161162
Settings = this.Settings,
162163
ProtectedSettings = this.ProtectedSettings,
163164
AutoUpgradeMinorVersion = !this.DisableAutoUpgradeMinorVersion.IsPresent,
164-
ForceUpdateTag = (this.ForceRerun.IsPresent) ? ForceUpdateTagTypes.RerunExtension : (ForceUpdateTagTypes?) null
165+
ForceUpdateTag = this.ForceRerun
165166
};
166167

167168
var op = this.VirtualMachineExtensionClient.CreateOrUpdateWithHttpMessagesAsync(

src/ResourceManager/Compute/Commands.Compute/Models/PSVirtualMachineExtension.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public string SubStatusesText
5959
get { return JsonConvert.SerializeObject(SubStatuses, Formatting.Indented); }
6060
}
6161
public bool? AutoUpgradeMinorVersion { get; set; }
62-
public ForceUpdateTagTypes? ForceUpdateTag { get; set; }
62+
public string ForceUpdateTag { get; set; }
6363
}
6464

6565
public static class PSVirtualMachineExtensionConversions

src/ResourceManager/Compute/Commands.Compute/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<package id="Microsoft.Azure.Graph.RBAC" version="1.9.0-preview" targetFramework="net45" />
1010
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net45" />
1111
<package id="Microsoft.Azure.Management.Authorization" version="1.0.0" targetFramework="net45" />
12-
<package id="Microsoft.Azure.Management.Compute" version="12.0.0-prerelease" targetFramework="net45" />
12+
<package id="Microsoft.Azure.Management.Compute" version="12.0.1-prerelease" targetFramework="net45" />
1313
<package id="Microsoft.Azure.Management.Network" version="3.3.0-preview" targetFramework="net45" />
1414
<package id="Microsoft.Azure.Management.Storage" version="3.0.0" targetFramework="net45" />
1515
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />

0 commit comments

Comments
 (0)