Skip to content

Commit ea07da8

Browse files
committed
Bug Fixes: Remove-AzureVMDscExtension cmdlet fix & Get-AzureVMDscExtensionStatus output pipielined to Update-AzureVM fix
1 parent 5a24c6a commit ea07da8

File tree

3 files changed

+74
-43
lines changed

3 files changed

+74
-43
lines changed

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,38 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using System.Globalization;
1516
using System.Management.Automation;
1617
using Microsoft.WindowsAzure.Commands.ServiceManagement.Model;
18+
using Microsoft.WindowsAzure.Commands.ServiceManagement.Properties;
1719

1820
namespace Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.Extensions
1921
{
22+
/// <summary>
23+
/// This cmdlet is used to remove DSC extension handler from a given virtual machine(s)
24+
/// in a cloud service.
25+
///
26+
/// Note: To get detailed output -Verbose flag need to be specified. Output of this cmdlet needs to be piped to Update-AzureVM cmdlet
27+
///
28+
/// Example Usage:
29+
///
30+
/// $vm = Get-AzureVM -ServiceName service -Name VM-name
31+
/// Remove-AzureVMDscExtension -VM $vm | Update-AzureVM -Verbose
32+
/// </summary>
2033
[Cmdlet(VerbsCommon.Remove, VirtualMachineDscExtensionCmdletNoun),
2134
OutputType(typeof(IPersistentVM))]
2235
public class RemoveAzureVMDscExtensionCommand : VirtualMachineDscExtensionCmdletBase
2336
{
2437

2538
internal void ExecuteCommand()
2639
{
40+
//this parameter needs to be true for remove to work
41+
this.Uninstall = true;
42+
this.Version = DefaultExtensionVersion;
43+
2744
RemovePredicateExtensions();
45+
AddResourceExtension();
46+
2847
WriteObject(VM);
2948
}
3049

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

Lines changed: 54 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -20276,21 +20276,23 @@ The default value is Production.</maml:para>
2027620276
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
2027720277
<!--Generated by PS Cmdlet Help Editor-->
2027820278
<command:details>
20279-
<command:name>Remove-AzureVMDscExtension</command:name>
20279+
<command:name>
20280+
Remove-AzureVMDscExtension
20281+
</command:name>
2028020282
<maml:description>
20281-
<maml:para>Remove Azure VM DSC Extension from a VM.</maml:para>
20283+
<maml:para>Removes DSC extension handler from a given virtual machine(s) in a cloud service. Output of this cmdlet needs to be piped to Update-AzureVM cmdlet. To get detailed output -Verbose flag need to be specified. </maml:para>
2028220284
</maml:description>
2028320285
<maml:copyright>
20284-
<maml:para />
20286+
<maml:para></maml:para>
2028520287
</maml:copyright>
2028620288
<command:verb>Remove</command:verb>
2028720289
<command:noun>AzureVMDscExtension</command:noun>
20288-
<dev:version />
20290+
<dev:version></dev:version>
2028920291
</command:details>
2029020292
<maml:description>
20291-
<!--This is the Description section-->
20292-
<maml:para>Remove Azure VM DSC Extension from a VM.</maml:para>
20293+
<maml:para>Removes DSC extension handler from a given virtual machine(s) in a cloud service. Output of this cmdlet needs to be piped to Update-AzureVM cmdlet. To get detailed output -Verbose flag need to be specified.</maml:para>
2029320294
</maml:description>
20295+
<!-- Cmdlet syntax section-->
2029420296
<command:syntax>
2029520297
<command:syntaxItem>
2029620298
<maml:name>Remove-AzureVMDscExtension</maml:name>
@@ -20303,83 +20305,92 @@ The default value is Production.</maml:para>
2030320305
</command:parameter>
2030420306
</command:syntaxItem>
2030520307
</command:syntax>
20308+
<!-- Cmdlet parameter section -->
2030620309
<command:parameters>
2030720310
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="named">
2030820311
<maml:name>VM</maml:name>
2030920312
<maml:description>
2031020313
<maml:para>The persistent VM object.</maml:para>
2031120314
</maml:description>
20312-
<command:parameterValue required="true" variableLength="false">IPersistentVM</command:parameterValue>
20315+
<command:parameterValue required="true" variableLength="false">IPersistentVM</command:parameterValue>
2031320316
<dev:type>
2031420317
<maml:name>IPersistentVM</maml:name>
2031520318
<maml:uri/>
2031620319
</dev:type>
2031720320
<dev:defaultValue></dev:defaultValue>
2031820321
</command:parameter>
2031920322
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
20320-
<maml:name>Confirm</maml:name>
20321-
<maml:description>
20322-
<maml:para>Prompts you for confirmation before executing the command.</maml:para>
20323-
</maml:description>
20324-
<command:parameterValue required="false" variableLength="false">switchparameter</command:parameterValue>
20325-
<dev:type>
20326-
<maml:name>switchparameter</maml:name>
20327-
<maml:uri/>
20328-
</dev:type>
20329-
<dev:defaultValue></dev:defaultValue>
20330-
</command:parameter>
20331-
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
20332-
<maml:name>WhatIf</maml:name>
20333-
<maml:description>
20334-
<maml:para>Describes what would happen if you executed the command without actually executing the command.</maml:para>
20335-
</maml:description>
20336-
<command:parameterValue required="false" variableLength="false">switchparameter</command:parameterValue>
20337-
<dev:type>
20338-
<maml:name>switchparameter</maml:name>
20339-
<maml:uri/>
20340-
</dev:type>
20341-
<dev:defaultValue></dev:defaultValue>
20342-
</command:parameter>
20323+
- <maml:name>Confirm</maml:name>
20324+
- <maml:description>
20325+
- <maml:para>Prompts you for confirmation before executing the command.</maml:para>
20326+
- </maml:description>
20327+
- <command:parameterValue required="false" variableLength="false">switchparameter</command:parameterValue>
20328+
- <dev:type>
20329+
- <maml:name>switchparameter</maml:name>
20330+
- <maml:uri/>
20331+
- </dev:type>
20332+
- <dev:defaultValue></dev:defaultValue>
20333+
- </command:parameter>
20334+
- <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
20335+
- <maml:name>WhatIf</maml:name>
20336+
- <maml:description>
20337+
- <maml:para>Describes what would happen if you executed the command without actually executing the command.</maml:para>
20338+
- </maml:description>
20339+
- <command:parameterValue required="false" variableLength="false">switchparameter</command:parameterValue>
20340+
- <dev:type>
20341+
- <maml:name>switchparameter</maml:name>
20342+
- <maml:uri/>
20343+
- </dev:type>
20344+
- <dev:defaultValue></dev:defaultValue>
20345+
- </command:parameter>
2034320346
</command:parameters>
20347+
<!-- Input - Output section-->
2034420348
<command:inputTypes>
2034520349
<command:inputType>
2034620350
<dev:type>
2034720351
<maml:name></maml:name>
2034820352
<maml:uri/>
20349-
<maml:description>
20350-
<maml:para></maml:para>
20351-
</maml:description>
20353+
<maml:description />
2035220354
</dev:type>
20353-
<maml:description></maml:description>
20355+
<maml:description>
20356+
<maml:para>
20357+
<!-- description -->
20358+
</maml:para>
20359+
</maml:description>
2035420360
</command:inputType>
2035520361
</command:inputTypes>
2035620362
<command:returnValues>
2035720363
<command:returnValue>
2035820364
<dev:type>
2035920365
<maml:name></maml:name>
2036020366
<maml:uri/>
20361-
<maml:description>
20362-
<maml:para></maml:para>
20363-
</maml:description>
20364-
</dev:type>
20367+
- <maml:description>
20368+
- <maml:para></maml:para>
20369+
- </maml:description>
20370+
- </dev:type>
2036520371
<maml:description></maml:description>
20366-
</command:returnValue>
20367-
</command:returnValues>
20368-
<command:terminatingErrors></command:terminatingErrors>
20369-
<command:nonTerminatingErrors></command:nonTerminatingErrors>
20372+
- </command:returnValue>
20373+
- </command:returnValues>
20374+
<!-- Error section-->
20375+
<command:terminatingErrors />
20376+
<command:nonTerminatingErrors />
20377+
<!-- Notes section -->
2037020378
<maml:alertSet>
2037120379
<maml:title></maml:title>
2037220380
<maml:alert>
2037320381
<maml:para></maml:para>
2037420382
</maml:alert>
20383+
<maml:alert>
20384+
<maml:para></maml:para>
20385+
</maml:alert>
2037520386
</maml:alertSet>
2037620387
<command:examples>
2037720388
<command:example>
2037820389
<maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title>
2037920390
<maml:introduction>
2038020391
<maml:para></maml:para>
2038120392
</maml:introduction>
20382-
<dev:code>PS C:\&gt; Remove-AzureVMDscExtension -VM $vm</dev:code>
20393+
<dev:code>PS C:\&gt; Remove-AzureVMDscExtension -VM $vm | Update-AzureVM</dev:code>
2038320394
<dev:remarks>
2038420395
<maml:para>Description</maml:para>
2038520396
</dev:remarks>

src/ServiceManagement/Compute/Commands.ServiceManagement/Microsoft.WindowsAzure.Commands.ServiceManagement.format.ps1xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,7 @@
650650
</View>
651651
<View>
652652
<Name>Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.Extensions.VirtualMachineDscExtensionStatusContext</Name>
653+
<OutOfBand />
653654
<ViewSelectedBy>
654655
<TypeName>Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.Extensions.VirtualMachineDscExtensionStatusContext</TypeName>
655656
</ViewSelectedBy>

0 commit comments

Comments
 (0)