diff --git a/src/ResourceManager/Compute/Commands.Compute/Extension/DSC/SetAzureVMDscExtensionCommand.cs b/src/ResourceManager/Compute/Commands.Compute/Extension/DSC/SetAzureVMDscExtensionCommand.cs index fdb7d91c817a..482110c79a7a 100644 --- a/src/ResourceManager/Compute/Commands.Compute/Extension/DSC/SetAzureVMDscExtensionCommand.cs +++ b/src/ResourceManager/Compute/Commands.Compute/Extension/DSC/SetAzureVMDscExtensionCommand.cs @@ -10,6 +10,7 @@ using Microsoft.WindowsAzure.Storage.Blob; using System; using System.Collections; +using System.Collections.Generic; using System.Globalization; using System.IO; using System.Management.Automation; @@ -207,6 +208,17 @@ public class SetAzureVMDscExtensionCommand : VirtualMachineExtensionBaseCmdlet [ValidateSetAttribute(new[] { "4.0", "latest", "5.0PP" })] public string WmfVersion { get; set; } + /// + /// The Extension Data Collection state + /// + [Parameter(ValueFromPipelineByPropertyName = true, + HelpMessage = "Enables or Disables Data Collection in the extension. It is enabled if it is not specified. " + + "The value is persisted in the extension between calls.") + ] + [ValidateSet("Enable", "Disable")] + [AllowNull] + public string DataCollection { get; set; } + //Private Variables private const string VersionRegexExpr = @"^(([0-9])\.)\d+$"; @@ -309,6 +321,11 @@ private void CreateConfiguration() publicSettings.SasToken = configurationUris.SasToken; publicSettings.ModulesUrl = configurationUris.ModulesUrl; + + Hashtable privacySetting = new Hashtable(); + privacySetting.Add("DataCollection", DataCollection); + publicSettings.Privacy = privacySetting; + publicSettings.ConfigurationFunction = string.Format( CultureInfo.InvariantCulture, "{0}\\{1}", diff --git a/src/ResourceManager/Compute/Commands.Compute/Microsoft.Azure.Commands.Compute.dll-Help.xml b/src/ResourceManager/Compute/Commands.Compute/Microsoft.Azure.Commands.Compute.dll-Help.xml index 63570e9894ce..44897d4d51c0 100644 --- a/src/ResourceManager/Compute/Commands.Compute/Microsoft.Azure.Commands.Compute.dll-Help.xml +++ b/src/ResourceManager/Compute/Commands.Compute/Microsoft.Azure.Commands.Compute.dll-Help.xml @@ -14089,6 +14089,13 @@ Set-AzureRmVMDiskEncryptionExtension -ResourceGroupName $rgname -VMName $vmName SwitchParameter + + DataCollection + + Enables or Disables Data Collection in the extension. It is enabled if it is not specified. The value is persisted in the extension between calls. Allowed Values are: Enable and Disable + + string + @@ -14287,6 +14294,18 @@ Set-AzureRmVMDiskEncryptionExtension -ResourceGroupName $rgname -VMName $vmName latest + + DataCollection + + Enables or Disables Data Collection in the extension. It is enabled if it is not specified. The value is persisted in the extension between calls. Allowed Values are: Enable and Disable + + string + + string + + + + InformationAction @@ -17670,4 +17689,4 @@ PS C:\> $VirtualMachine07 = Set-AzureRmVMSourceImage -VM $VirtualMachine07 -I - \ No newline at end of file + diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/DscExtensionPublicSettings.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/DscExtensionPublicSettings.cs index 93ccec9f7a7e..727700139e0f 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/DscExtensionPublicSettings.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/DscExtensionPublicSettings.cs @@ -92,6 +92,11 @@ public class Property /// public Property[] Properties { get; set; } + /// + /// Privacy parameters + /// + public Hashtable Privacy { get; set; } + /// /// Version of the protocol (DscExtensionPublicSettings and DscExtensionPrivateSettings mostly). /// diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/SetAzureVMDscExtension.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/SetAzureVMDscExtension.cs index c74d60370a3b..20821caae297 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/SetAzureVMDscExtension.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/SetAzureVMDscExtension.cs @@ -23,6 +23,7 @@ using Microsoft.WindowsAzure.Storage.Blob; using System; using System.Collections; +using System.Collections.Generic; using System.Globalization; using System.IO; using System.Management.Automation; @@ -156,6 +157,17 @@ public class SetAzureVMDscExtension : VirtualMachineExtensionCmdletBase [ValidateSetAttribute(new[] { "4.0", "latest", "5.0PP" })] public string WmfVersion { get; set; } + /// + /// The Extension Data Collection state + /// + [Parameter(ValueFromPipelineByPropertyName = true, + HelpMessage = "Enables or Disables Data Collection in the extension. It is enabled if it is not specified. " + + "The value is persisted in the extension between calls.") + ] + [ValidateSet("Enable", "Disable")] + [AllowNull] + public string DataCollection { get; set; } + /// /// Credentials used to access Azure Storage /// @@ -389,6 +401,11 @@ private void CreateConfiguration() publicSettings.SasToken = configurationUris.SasToken; publicSettings.ModulesUrl = configurationUris.ModulesUrl; + + Hashtable privacySetting = new Hashtable(); + privacySetting.Add("DataCollection",DataCollection); + publicSettings.Privacy = privacySetting; + publicSettings.ConfigurationFunction = string.Format( CultureInfo.InvariantCulture, "{0}\\{1}", diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/Microsoft.WindowsAzure.Commands.ServiceManagement.dll-Help.xml b/src/ServiceManagement/Compute/Commands.ServiceManagement/Microsoft.WindowsAzure.Commands.ServiceManagement.dll-Help.xml index 932c942e61d4..508f5387bb85 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement/Microsoft.WindowsAzure.Commands.ServiceManagement.dll-Help.xml +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/Microsoft.WindowsAzure.Commands.ServiceManagement.dll-Help.xml @@ -36528,6 +36528,13 @@ PS C:\> Update-AzureVM -ServiceName $Service_Name -Name $VM_Name -VM $VM_Upda IPersistentVM + + DataCollection + + Enables or Disables Data Collection in the extension. It is enabled if it is not specified. The value is persisted in the extension between calls. Allowed Values are: Enable and Disable + + string + Confirm @@ -36695,6 +36702,18 @@ PS C:\> Update-AzureVM -ServiceName $Service_Name -Name $VM_Name -VM $VM_Upda none + + DataCollection + + Enables or Disables Data Collection in the extension. It is enabled if it is not specified. The value is persisted in the extension between calls. Allowed Values are: Enable and Disable + + string + + string + + + + Confirm