diff --git a/src/ResourceManager/Compute/Commands.Compute/Extension/DSC/SetAzureVMDscExtensionCommand.cs b/src/ResourceManager/Compute/Commands.Compute/Extension/DSC/SetAzureVMDscExtensionCommand.cs index f058ff89d3e5..18eff4713897 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; @@ -206,6 +207,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+$"; @@ -310,6 +322,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 977eeded5b29..aaaa89f1e3d2 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 @@ -9932,6 +9932,13 @@ Get-AzureRmVMDscExtension -ResourceGroupName Name -VMName VM -Name 'DSC' string + + 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 + Force @@ -10227,6 +10234,18 @@ Get-AzureRmVMDscExtension -ResourceGroupName Name -VMName VM -Name 'DSC' 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 + + + + 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 32a90d90ec19..6d81d3067a7e 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 e02fec21aefd..182092c871f0 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 @@ -33144,6 +33144,13 @@ If omitted, this parameter will default to the name of the file given by the Con 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 + WhatIf @@ -33356,6 +33363,18 @@ A value of "5.0PP" will install the latest release of WMF 5.0PP (http://go.micro 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 + + + +