Skip to content

Commit 3f132c7

Browse files
committed
error message for wmf 5.1pp
1 parent c46f4e7 commit 3f132c7

File tree

6 files changed

+38
-4
lines changed

6 files changed

+38
-4
lines changed

src/ResourceManager/Compute/Commands.Compute/Extension/DSC/SetAzureVMDscExtensionCommand.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public class SetAzureVMDscExtensionCommand : VirtualMachineExtensionBaseCmdlet
187187
///
188188
/// The DSC Azure Extension depends on DSC features that are only available in
189189
/// the WMF updates. This parameter specifies which version of the update to
190-
/// install on the VM. The possible values are "4.0","5.0" ,"5.1PP" and "latest".
190+
/// install on the VM. The possible values are "4.0","5.0" ,"5.1" and "latest".
191191
///
192192
/// A value of "4.0" will install WMF 4.0 Update packages
193193
/// (https://support.microsoft.com/en-us/kb/3119938) on Windows 8.1 or Windows Server
@@ -206,7 +206,7 @@ public class SetAzureVMDscExtensionCommand : VirtualMachineExtensionBaseCmdlet
206206
/// The default value is "latest"
207207
/// </summary>
208208
[Parameter(ValueFromPipelineByPropertyName = true)]
209-
[ValidateSetAttribute(new[] { "4.0", "5.0", "5.1", "latest" })]
209+
[ValidateSetAttribute(new[] {"4.0", "5.0", "5.1", "5.1PP", "latest"})]
210210
public string WmfVersion { get; set; }
211211

212212
/// <summary>
@@ -240,6 +240,11 @@ public override void ExecuteCmdlet()
240240
//Private Methods
241241
private void ValidateParameters()
242242
{
243+
if ("5.1PP".Equals(WmfVersion))
244+
{
245+
this.ThrowInvalidArgumentError(Microsoft.Azure.Commands.Compute.Properties.Resources.WMFVersionNotSupported, WmfVersion);
246+
}
247+
243248
if (string.IsNullOrEmpty(ArchiveBlobName))
244249
{
245250
if (ConfigurationName != null || ConfigurationArgument != null

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

Lines changed: 9 additions & 0 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
@@ -218,6 +218,9 @@ The file needs to be a PowerShell script (.ps1 or .psm1) or a ZIP archive (.zip)
218218
The file needs to be a PowerShell script (.ps1 or .psm1).</value>
219219
<comment>0 = path to the configuration file</comment>
220220
</data>
221+
<data name="WMFVersionNotSupported" xml:space="preserve">
222+
<value>WMF Version {0} is not supported anymore. </value>
223+
</data>
221224
<data name="AzureVMDscNullArchiveNoConfiguragionParameters" xml:space="preserve">
222225
<value>If the ConfigurationArchive argument is null, then the ConfigurationName, ConfigurationArgument, and ConfigurationDataPath parameters must not be specified </value>
223226
</data>

src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/SetAzureVMDscExtension.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public class SetAzureVMDscExtension : VirtualMachineExtensionCmdletBase
138138
///
139139
/// The DSC Azure Extension depends on DSC features that are only available in
140140
/// the WMF updates. This parameter specifies which version of the update to
141-
/// install on the VM. The possible values are "4.0","5.0" ,"5.1PP" and "latest".
141+
/// install on the VM. The possible values are "4.0","5.0" ,"5.1" and "latest".
142142
///
143143
/// A value of "4.0" will install WMF 4.0 Update packages
144144
/// (https://support.microsoft.com/en-us/kb/3119938) on Windows 8.1 or Windows Server
@@ -157,7 +157,7 @@ public class SetAzureVMDscExtension : VirtualMachineExtensionCmdletBase
157157
/// The default value is "latest"
158158
/// </summary>
159159
[Parameter(ValueFromPipelineByPropertyName = true)]
160-
[ValidateSetAttribute(new[] { "4.0", "5.0", "5.1", "latest" })]
160+
[ValidateSetAttribute(new[] { "4.0", "5.0", "5.1", "5.1PP", "latest" })]
161161
public string WmfVersion { get; set; }
162162

163163
/// <summary>
@@ -225,6 +225,11 @@ protected override void ValidateParameters()
225225
//
226226
// Validate parameters
227227
//
228+
if ("5.1PP".Equals(WmfVersion))
229+
{
230+
this.ThrowInvalidArgumentError(Resources.WMFVersionNotSupported, WmfVersion);
231+
}
232+
228233
if (string.IsNullOrEmpty(ConfigurationArchive))
229234
{
230235
if (ConfigurationName != null || ConfigurationArgument != null

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

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

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,9 @@
639639
<data name="AzureVMDscCannotFindConfigurationDataFile" xml:space="preserve">
640640
<value>Cannot find configuration data file: {0}</value>
641641
</data>
642+
<data name="WMFVersionNotSupported" xml:space="preserve">
643+
<value>WMF Version {0} is not supported anymore. </value>
644+
</data>
642645
<data name="AzureVMDscConfigurationDataFileShouldNotIncludePath" xml:space="preserve">
643646
<value>The -ConfigurationArchive parameter must no include a path</value>
644647
</data>

0 commit comments

Comments
 (0)