Skip to content

Commit 4f5f9a5

Browse files
committed
Merge pull request #1035 from dscsolutions/wmfparam
New wmfversion param in set cmdlet for ARM and ASM
2 parents bc1b9ba + 5d352cc commit 4f5f9a5

File tree

5 files changed

+119
-6
lines changed

5 files changed

+119
-6
lines changed

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

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,33 @@ public class SetAzureVMDscExtensionCommand : VirtualMachineExtensionBaseCmdlet
180180
[Parameter(
181181
HelpMessage = "Extension handler gets auto updated to the latest version if this switch is present.")]
182182
public SwitchParameter AutoUpdate { get; set; }
183-
//Private Variables
184183

184+
/// <summary>
185+
/// Specifies the version of the Windows Management Framework (WMF) to install
186+
/// on the VM.
187+
///
188+
/// The DSC Azure Extension depends on DSC features that are only available in
189+
/// the WMF updates. This parameter specifies which version of the update to
190+
/// install on the VM. The possible values are "4.0","latest" and "5.0PP".
191+
///
192+
/// A value of "4.0" will install KB3000850
193+
/// (http://support.microsoft.com/kb/3000850) on Windows 8.1 or Windows Server
194+
/// 2012 R2, or WMF 4.0
195+
/// (http://www.microsoft.com/en-us/download/details.aspx?id=40855) on other
196+
/// versions of Windows if a newer version isnt already installed.
197+
///
198+
/// A value of "5.0PP" will install the latest release of WMF 5.0PP
199+
/// (http://go.microsoft.com/fwlink/?LinkId=398175).
200+
///
201+
/// A value of "latest" will install the latest WMF, currently WMF 5.0PP
202+
///
203+
/// The default value is "latest"
204+
/// </summary>
205+
[Parameter(ValueFromPipelineByPropertyName = true)]
206+
[ValidateSetAttribute(new[] { "4.0", "latest", "5.0PP" })]
207+
public string WmfVersion { get; set; }
208+
209+
//Private Variables
185210
private const string VersionRegexExpr = @"^(([0-9])\.)\d+$";
186211

187212
/// <summary>
@@ -276,7 +301,9 @@ private void CreateConfiguration()
276301
{
277302
var publicSettings = new DscExtensionPublicSettings();
278303
var privateSettings = new DscExtensionPrivateSettings();
279-
304+
305+
publicSettings.WmfVersion = string.IsNullOrEmpty(WmfVersion) ? "latest" : WmfVersion;
306+
280307
if (!string.IsNullOrEmpty(ArchiveBlobName))
281308
{
282309
ConfigurationUris configurationUris = UploadConfigurationDataToBlob();

src/ResourceManager/Compute/Commands.Compute/Microsoft.Azure.Commands.Compute.dll-Help.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9736,6 +9736,17 @@ Get-AzureRmVMDscExtension -ResourceGroupName Name -VMName VM -Name 'DSC' </dev:c
97369736
<maml:para>Describes what would happen if you executed the command without actually executing the command.</maml:para>
97379737
</maml:description>
97389738
</command:parameter>
9739+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
9740+
<maml:name>WmfVersion</maml:name>
9741+
<maml:description>
9742+
<maml:para>
9743+
Specifies the version of the Windows Management Framework (WMF) to install on the VM. The DSC Azure Extension depends on DSC features that are only available in the WMF updates. This parameter specifies which version of the update to install on the VM. The possible values are &quot;4.0&quot;,&quot;latest&quot; and &quot;5.0PP&quot;.
9744+
A value of &quot;4.0&quot; will install KB3000850 (http://support.microsoft.com/kb/3000850) on Windows 8.1 or Windows Server 2012 R2, or WMF 4.0 (http://www.microsoft.com/en-us/download/details.aspx?id=40855) on other versions of Windows if a newer version isnt already installed.
9745+
A value of &quot;5.0PP&quot; will install the latest release of WMF 5.0PP (http://go.microsoft.com/fwlink/?LinkId=398175). A value of &quot;latest&quot; will install the latest WMF, currently WMF 5.0PP. The default value is &quot;latest&quot;
9746+
</maml:para>
9747+
</maml:description>
9748+
<command:parameterValue required="true" variableLength="false">string</command:parameterValue>
9749+
</command:parameter>
97399750
</command:syntaxItem>
97409751
</command:syntax>
97419752
<!-- Cmdlet parameter section -->
@@ -9945,6 +9956,23 @@ Get-AzureRmVMDscExtension -ResourceGroupName Name -VMName VM -Name 'DSC' </dev:c
99459956
</dev:type>
99469957
<dev:defaultValue />
99479958
</command:parameter>
9959+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
9960+
<maml:name>WmfVersion</maml:name>
9961+
<maml:description>
9962+
<maml:para>
9963+
Specifies the version of the Windows Management Framework (WMF) to install on the VM. The DSC Azure Extension depends on DSC features that are only available in the WMF updates. This parameter specifies which version of the update to install on the VM. The possible values are &quot;4.0&quot;,&quot;latest&quot; and &quot;5.0PP&quot;.
9964+
A value of &quot;4.0&quot; will install KB3000850 (http://support.microsoft.com/kb/3000850) on Windows 8.1 or Windows Server 2012 R2, or WMF 4.0 (http://www.microsoft.com/en-us/download/details.aspx?id=40855) on other versions of Windows if a newer version isnt already installed.
9965+
A value of &quot;5.0PP&quot; will install the latest release of WMF 5.0PP (http://go.microsoft.com/fwlink/?LinkId=398175). A value of &quot;latest&quot; will install the latest WMF, currently WMF 5.0PP. The default value is &quot;latest&quot;
9966+
</maml:para>
9967+
9968+
</maml:description>
9969+
<command:parameterValue required="true" variableLength="false">string</command:parameterValue>
9970+
<dev:type>
9971+
<maml:name>string</maml:name>
9972+
<maml:uri/>
9973+
</dev:type>
9974+
<dev:defaultValue>latest</dev:defaultValue>
9975+
</command:parameter>
99489976
</command:parameters>
99499977
<!-- Input - Output section-->
99509978
<command:inputTypes>

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,11 @@ public class Property
9696
/// Version of the protocol (DscExtensionPublicSettings and DscExtensionPrivateSettings mostly).
9797
/// </summary>
9898
public Version ProtocolVersion { get; set; }
99+
100+
/// <summary>
101+
/// Specifies the version of the Windows Management Framework (WMF) to install
102+
/// on the VM.
103+
/// </summary>
104+
public string WmfVersion { get; set; }
99105
}
100106
}

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

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,36 @@ public class SetAzureVMDscExtension : VirtualMachineExtensionCmdletBase
126126
/// <summary>
127127
/// The DNS endpoint suffix for all storage services, e.g. "core.windows.net".
128128
/// </summary>
129-
[Parameter(ValueFromPipelineByPropertyName = true, HelpMessage = "The Storage Endpoint Suffix.")]
129+
[Parameter(ValueFromPipelineByPropertyName = true,
130+
HelpMessage = "The Storage Endpoint Suffix.")]
130131
[ValidateNotNullOrEmpty]
131132
public string StorageEndpointSuffix { get; set; }
132133

134+
/// <summary>
135+
/// Specifies the version of the Windows Management Framework (WMF) to install
136+
/// on the VM.
137+
///
138+
/// The DSC Azure Extension depends on DSC features that are only available in
139+
/// the WMF updates. This parameter specifies which version of the update to
140+
/// install on the VM. The possible values are "4.0","latest" and "5.0PP".
141+
///
142+
/// A value of "4.0" will install KB3000850
143+
/// (http://support.microsoft.com/kb/3000850) on Windows 8.1 or Windows Server
144+
/// 2012 R2, or WMF 4.0
145+
/// (http://www.microsoft.com/en-us/download/details.aspx?id=40855) on other
146+
/// versions of Windows if a newer version isnt already installed.
147+
///
148+
/// A value of "5.0PP" will install the latest release of WMF 5.0PP
149+
/// (http://go.microsoft.com/fwlink/?LinkId=398175).
150+
///
151+
/// A value of "latest" will install the latest WMF, currently WMF 5.0PP
152+
///
153+
/// The default value is "latest"
154+
/// </summary>
155+
[Parameter(ValueFromPipelineByPropertyName = true)]
156+
[ValidateSetAttribute(new[] { "4.0", "latest", "5.0PP" })]
157+
public string WmfVersion { get; set; }
158+
133159
/// <summary>
134160
/// Credentials used to access Azure Storage
135161
/// </summary>
@@ -354,7 +380,9 @@ private void CreateConfiguration()
354380
{
355381
var publicSettings = new DscExtensionPublicSettings();
356382
var privateSettings = new DscExtensionPrivateSettings();
357-
383+
384+
publicSettings.WmfVersion = string.IsNullOrEmpty(WmfVersion) ? "latest" : WmfVersion;
385+
358386
if (!string.IsNullOrEmpty(ConfigurationArchive))
359387
{
360388
ConfigurationUris configurationUris = UploadConfigurationDataToBlob();

src/ServiceManagement/Compute/Commands.ServiceManagement/Microsoft.WindowsAzure.Commands.ServiceManagement.dll-Help.xml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30340,7 +30340,16 @@ If omitted, this parameter will default to the name of the file given by the Con
3034030340
</maml:description>
3034130341
<command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
3034230342
</command:parameter>
30343-
</command:syntaxItem>
30343+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
30344+
<maml:name>WmfVersion</maml:name>
30345+
<maml:description>
30346+
<maml:para>Specifies the version of the Windows Management Framework (WMF) to install on the VM. The DSC Azure Extension depends on DSC features that are only available in the WMF updates. This parameter specifies which version of the update to install on the VM. The possible values are &quot;4.0&quot;,&quot;latest&quot; and &quot;5.0PP&quot;.
30347+
A value of &quot;4.0&quot; will install KB3000850 (http://support.microsoft.com/kb/3000850) on Windows 8.1 or Windows Server 2012 R2, or WMF 4.0 (http://www.microsoft.com/en-us/download/details.aspx?id=40855) on other versions of Windows if a newer version isnt already installed.
30348+
A value of &quot;5.0PP&quot; will install the latest release of WMF 5.0PP (http://go.microsoft.com/fwlink/?LinkId=398175). A value of &quot;latest&quot; will install the latest WMF, currently WMF 5.0PP. The default value is &quot;latest&quot;</maml:para>
30349+
</maml:description>
30350+
<command:parameterValue required="true" variableLength="false">string</command:parameterValue>
30351+
</command:parameter>
30352+
</command:syntaxItem>
3034430353
</command:syntax>
3034530354
<command:parameters>
3034630355
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
@@ -30504,7 +30513,22 @@ If omitted, this parameter will default to the name of the file given by the Con
3050430513
</dev:type>
3050530514
<dev:defaultValue></dev:defaultValue>
3050630515
</command:parameter>
30507-
</command:parameters>
30516+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named">
30517+
<maml:name>WmfVersion</maml:name>
30518+
<maml:description>
30519+
<maml:para>Specifies the version of the Windows Management Framework (WMF) to install on the VM. The DSC Azure Extension depends on DSC features that are only available in the WMF updates. This parameter specifies which version of the update to install on the VM. The possible values are &quot;4.0&quot;,&quot;latest&quot; and &quot;5.0PP&quot;.
30520+
A value of &quot;4.0&quot; will install KB3000850 (http://support.microsoft.com/kb/3000850) on Windows 8.1 or Windows Server 2012 R2, or WMF 4.0 (http://www.microsoft.com/en-us/download/details.aspx?id=40855) on other versions of Windows if a newer version isnt already installed.
30521+
A value of &quot;5.0PP&quot; will install the latest release of WMF 5.0PP (http://go.microsoft.com/fwlink/?LinkId=398175). A value of &quot;latest&quot; will install the latest WMF, currently WMF 5.0PP. The default value is &quot;latest&quot;</maml:para>
30522+
30523+
</maml:description>
30524+
<command:parameterValue required="true" variableLength="false">string</command:parameterValue>
30525+
<dev:type>
30526+
<maml:name>string</maml:name>
30527+
<maml:uri/>
30528+
</dev:type>
30529+
<dev:defaultValue>latest</dev:defaultValue>
30530+
</command:parameter>
30531+
</command:parameters>
3050830532
<command:inputTypes>
3050930533
<command:inputType>
3051030534
<dev:type>

0 commit comments

Comments
 (0)