diff --git a/src/Resources/Authorization.Autorest/Az.Authorization.psd1 b/src/Resources/Authorization.Autorest/Az.Authorization.psd1 index 8b8f395df90d..1aab66811b2a 100644 --- a/src/Resources/Authorization.Autorest/Az.Authorization.psd1 +++ b/src/Resources/Authorization.Autorest/Az.Authorization.psd1 @@ -1,5 +1,5 @@ @{ - GUID = '35fb50e5-5759-4cce-99c9-41fcbe73bee8' + GUID = '6e38b027-1850-467b-9682-953545209e51' RootModule = './Az.Authorization.psm1' ModuleVersion = '0.1.0' CompatiblePSEditions = 'Core', 'Desktop' diff --git a/src/Resources/Authorization.Autorest/Az.Authorization.psm1 b/src/Resources/Authorization.Autorest/Az.Authorization.psm1 index 6dcfd0fe92e9..874ddb32321a 100644 --- a/src/Resources/Authorization.Autorest/Az.Authorization.psm1 +++ b/src/Resources/Authorization.Autorest/Az.Authorization.psm1 @@ -47,37 +47,41 @@ # Ask for the shared functionality table $VTable = Register-AzModule - + # Tweaks the pipeline on module load $instance.OnModuleLoad = $VTable.OnModuleLoad # Following two delegates are added for telemetry $instance.GetTelemetryId = $VTable.GetTelemetryId $instance.Telemetry = $VTable.Telemetry - + + # Delegate to sanitize the output object + $instance.SanitizeOutput = $VTable.SanitizerHandler + + # Delegate to get the telemetry info + $instance.GetTelemetryInfo = $VTable.GetTelemetryInfo # Tweaks the pipeline per call $instance.OnNewRequest = $VTable.OnNewRequest - + # Gets shared parameter values $instance.GetParameterValue = $VTable.GetParameterValue - + # Allows shared module to listen to events from this module $instance.EventListener = $VTable.EventListener - + # Gets shared argument completers $instance.ArgumentCompleter = $VTable.ArgumentCompleter - + # The name of the currently selected Azure profile $instance.ProfileName = $VTable.ProfileName - # Load the custom module $customModulePath = Join-Path $PSScriptRoot './custom/Az.Authorization.custom.psm1' if(Test-Path $customModulePath) { $null = Import-Module -Name $customModulePath } - + # Export nothing to clear implicit exports Export-ModuleMember @@ -97,12 +101,12 @@ # Load the last folder if no profile is selected $profileDirectory = $directories | Select-Object -Last 1 } - + if($profileDirectory) { Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'" $exportsPath = $profileDirectory.FullName } - + if($exportsPath) { Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName } $cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath diff --git a/src/Resources/Authorization.Autorest/generated/Module.cs b/src/Resources/Authorization.Autorest/generated/Module.cs index acb7dfd0aa60..d32f2a1d3337 100644 --- a/src/Resources/Authorization.Autorest/generated/Module.cs +++ b/src/Resources/Authorization.Autorest/generated/Module.cs @@ -17,6 +17,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization using SignalDelegate = global::System.Func, global::System.Threading.Tasks.Task>; using EventListenerDelegate = global::System.Func, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Management.Automation.InvocationInfo, string, string, string, global::System.Exception, global::System.Threading.Tasks.Task>; using NextDelegate = global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>; + using SanitizerDelegate = global::System.Action; + using GetTelemetryInfoDelegate = global::System.Func>; /// A class that contains the module-common code and data. public partial class Module @@ -51,6 +53,9 @@ public partial class Module /// The delegate to get the telemetry Id. public GetTelemetryIdDelegate GetTelemetryId { get; set; } + /// The delegate to get the telemetry info. + public GetTelemetryInfoDelegate GetTelemetryInfo { get; set; } + /// Backing field for property. private static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module _instance; @@ -72,6 +77,9 @@ public partial class Module /// The ResourceID for this module (azure arm). public string ResourceId => @"Az.Authorization"; + /// The delegate to call in WriteObject to sanitize the output object. + public SanitizerDelegate SanitizeOutput { get; set; } + /// The delegate for creating a telemetry. public TelemetryDelegate Telemetry { get; set; } diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_Get.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_Get.cs index 812b9cefcfd6..429f6f0803df 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_Get.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_Get.cs @@ -170,7 +170,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// @@ -316,6 +333,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_GetViaIdentity.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_GetViaIdentity.cs index 938c9ff8857a..57923bee8811 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_GetViaIdentity.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_GetViaIdentity.cs @@ -149,7 +149,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// @@ -311,6 +328,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_List.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_List.cs index cc1cbd75e56b..7ac7823d83f2 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_List.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_List.cs @@ -180,7 +180,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// @@ -326,6 +343,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_Get.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_Get.cs index 2624e92b504a..17c7d54d1665 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_Get.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_Get.cs @@ -170,7 +170,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// @@ -316,6 +333,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_GetViaIdentity.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_GetViaIdentity.cs index d9f50273d767..1acd1dec2eab 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_GetViaIdentity.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_GetViaIdentity.cs @@ -149,7 +149,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// @@ -311,6 +328,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_List.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_List.cs index eea4c950f7d1..abce2dee5433 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_List.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_List.cs @@ -181,7 +181,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// @@ -327,6 +344,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_Get.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_Get.cs index 3f532db3b0dc..aaa59ec8222e 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_Get.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_Get.cs @@ -170,7 +170,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// @@ -316,6 +333,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_GetViaIdentity.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_GetViaIdentity.cs index 0faa60248642..81057ce041c7 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_GetViaIdentity.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_GetViaIdentity.cs @@ -149,7 +149,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// @@ -311,6 +328,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_List.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_List.cs index 00ea4c28d822..705963db42c6 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_List.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_List.cs @@ -180,7 +180,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// @@ -326,6 +343,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_Get.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_Get.cs index 060ca40e7653..1493a9f81915 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_Get.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_Get.cs @@ -172,7 +172,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// @@ -318,6 +335,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_GetViaIdentity.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_GetViaIdentity.cs index d873e83000c6..3c1abf14ae47 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_GetViaIdentity.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_GetViaIdentity.cs @@ -149,7 +149,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// @@ -311,6 +328,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_List.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_List.cs index 30810cc8ac50..ff971b526b84 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_List.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_List.cs @@ -180,7 +180,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// @@ -326,6 +343,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_Get.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_Get.cs index 5e9e6accea08..51cb36c485ae 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_Get.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_Get.cs @@ -170,7 +170,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// @@ -316,6 +333,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_GetViaIdentity.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_GetViaIdentity.cs index 858eb2cd6f5e..f4274c915a14 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_GetViaIdentity.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_GetViaIdentity.cs @@ -149,7 +149,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// @@ -311,6 +328,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_List.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_List.cs index f8d38bf72ec4..804b2c7e6308 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_List.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_List.cs @@ -181,7 +181,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// @@ -327,6 +344,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_Get.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_Get.cs index 332a7ef8a24d..b4a3f0ebf257 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_Get.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_Get.cs @@ -170,7 +170,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// @@ -316,6 +333,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_GetViaIdentity.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_GetViaIdentity.cs index f5e61775c028..701b708b9926 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_GetViaIdentity.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_GetViaIdentity.cs @@ -149,7 +149,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// @@ -311,6 +328,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_List.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_List.cs index efcea47c1770..8edba77dd31e 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_List.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_List.cs @@ -180,7 +180,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// @@ -326,6 +343,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibleChildResource_Get.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibleChildResource_Get.cs index 515226c83e9e..297a2b811358 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibleChildResource_Get.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibleChildResource_Get.cs @@ -179,7 +179,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// @@ -325,6 +342,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibleChildResource_GetViaIdentity.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibleChildResource_GetViaIdentity.cs index 535f193ed0e1..9231d862203d 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibleChildResource_GetViaIdentity.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibleChildResource_GetViaIdentity.cs @@ -173,7 +173,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// @@ -331,6 +348,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_Get.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_Get.cs index a4a0609db2fc..44f9fca25201 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_Get.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_Get.cs @@ -170,7 +170,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// @@ -316,6 +333,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_GetViaIdentity.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_GetViaIdentity.cs index 1936afdd741a..c16034f7ed22 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_GetViaIdentity.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_GetViaIdentity.cs @@ -149,7 +149,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// @@ -311,6 +328,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_List.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_List.cs index f15d5b83c326..774ad527b8de 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_List.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_List.cs @@ -161,7 +161,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// @@ -307,6 +324,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_Get.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_Get.cs index 7ea229cd49ee..d83f78151f48 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_Get.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_Get.cs @@ -170,7 +170,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// @@ -316,6 +333,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_GetViaIdentity.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_GetViaIdentity.cs index 65ec71a1adee..39599428443a 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_GetViaIdentity.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_GetViaIdentity.cs @@ -149,7 +149,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// @@ -311,6 +328,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_List.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_List.cs index 7e2f38d7c6a4..2393c8cdd269 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_List.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_List.cs @@ -161,7 +161,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// @@ -307,6 +324,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleAssignmentScheduleRequest_CreateExpanded.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleAssignmentScheduleRequest_CreateExpanded.cs index 15c55d00d823..e4ebc31ad4f3 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleAssignmentScheduleRequest_CreateExpanded.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleAssignmentScheduleRequest_CreateExpanded.cs @@ -352,7 +352,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -501,6 +518,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// a delegate that is called when the remote service returns 201 (Created). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleEligibilityScheduleRequest_CreateExpanded.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleEligibilityScheduleRequest_CreateExpanded.cs index 41a1d9a33484..073aca1a8833 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleEligibilityScheduleRequest_CreateExpanded.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleEligibilityScheduleRequest_CreateExpanded.cs @@ -341,7 +341,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -490,6 +507,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// a delegate that is called when the remote service returns 201 (Created). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleManagementPolicyAssignment_CreateExpanded.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleManagementPolicyAssignment_CreateExpanded.cs index 2e3f635d0ff6..bee7ab1754db 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleManagementPolicyAssignment_CreateExpanded.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleManagementPolicyAssignment_CreateExpanded.cs @@ -195,7 +195,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -344,6 +361,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// a delegate that is called when the remote service returns 201 (Created). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_Delete.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_Delete.cs index cc039b8c2cd7..2d9eb8741426 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_Delete.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_Delete.cs @@ -185,7 +185,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -334,6 +351,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_DeleteViaIdentity.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_DeleteViaIdentity.cs index 02e62efc884b..f838f72a512a 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_DeleteViaIdentity.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_DeleteViaIdentity.cs @@ -164,7 +164,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -329,6 +346,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_Delete.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_Delete.cs index 5ae0c823ab12..4faac11068c0 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_Delete.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_Delete.cs @@ -185,7 +185,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -334,6 +351,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_DeleteViaIdentity.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_DeleteViaIdentity.cs index c3f21e8c6b1d..59fed88e148f 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_DeleteViaIdentity.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_DeleteViaIdentity.cs @@ -164,7 +164,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -329,6 +346,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_Cancel.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_Cancel.cs index ece32811fe5f..6e642ad1b380 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_Cancel.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_Cancel.cs @@ -175,7 +175,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -324,6 +341,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_CancelViaIdentity.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_CancelViaIdentity.cs index cf5b9a4008ec..2507f19586db 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_CancelViaIdentity.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_CancelViaIdentity.cs @@ -154,7 +154,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -319,6 +336,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_Cancel.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_Cancel.cs index b996e0401ebb..7774cb13db55 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_Cancel.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_Cancel.cs @@ -175,7 +175,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -324,6 +341,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_CancelViaIdentity.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_CancelViaIdentity.cs index dcb9b533a7f5..6a1e2f5173b0 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_CancelViaIdentity.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_CancelViaIdentity.cs @@ -154,7 +154,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -319,6 +336,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateExpanded.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateExpanded.cs index ca2966f511ac..7068caccfaf0 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateExpanded.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateExpanded.cs @@ -218,7 +218,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -367,6 +384,21 @@ public UpdateAzRoleManagementPolicy_UpdateExpanded() } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded.cs b/src/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded.cs index 90459e674fd7..ece559ba7823 100644 --- a/src/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded.cs +++ b/src/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded.cs @@ -197,7 +197,24 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -362,6 +379,21 @@ public UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded() } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// diff --git a/src/Resources/Authorization.Autorest/help/Az.Authorization.md b/src/Resources/Authorization.Autorest/help/Az.Authorization.md index a5d4af646245..e8d5f2dcb9e9 100644 --- a/src/Resources/Authorization.Autorest/help/Az.Authorization.md +++ b/src/Resources/Authorization.Autorest/help/Az.Authorization.md @@ -1,6 +1,6 @@ --- Module Name: Az.Authorization -Module Guid: 35fb50e5-5759-4cce-99c9-41fcbe73bee8 +Module Guid: 6e38b027-1850-467b-9682-953545209e51 Download Help Link: https://learn.microsoft.com/powershell/module/az.authorization Help Version: 1.0.0.0 Locale: en-US diff --git a/src/Resources/Authorization.Autorest/internal/Az.Authorization.internal.psm1 b/src/Resources/Authorization.Autorest/internal/Az.Authorization.internal.psm1 index 87bb6a5fdff4..51af7b25d152 100644 --- a/src/Resources/Authorization.Autorest/internal/Az.Authorization.internal.psm1 +++ b/src/Resources/Authorization.Autorest/internal/Az.Authorization.internal.psm1 @@ -24,12 +24,12 @@ # Load the last folder if no profile is selected $profileDirectory = $directories | Select-Object -Last 1 } - + if($profileDirectory) { Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'" $exportsPath = $profileDirectory.FullName } - + if($exportsPath) { Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName } $cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath diff --git a/src/Resources/Policy.Autorest/custom/Get-AzPolicyDefinition.ps1 b/src/Resources/Policy.Autorest/custom/Get-AzPolicyDefinition.ps1 index 1b8ffe1ad7a5..ddcd5562e43c 100644 --- a/src/Resources/Policy.Autorest/custom/Get-AzPolicyDefinition.ps1 +++ b/src/Resources/Policy.Autorest/custom/Get-AzPolicyDefinition.ps1 @@ -183,6 +183,8 @@ begin { } process { + $PSBoundParameters['ErrorAction'] = 'Stop' + if ($writeln) { Write-Host -ForegroundColor Cyan "process:Get-AzPolicyDefinition(" $PSBoundParameters ") - (ParameterSet: $($PSCmdlet.ParameterSetName))" } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyAssignment_Get.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyAssignment_Get.cs index 85484cd00961..b6716cee52a0 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyAssignment_Get.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyAssignment_Get.cs @@ -206,11 +206,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyAssignment_Get1.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyAssignment_Get1.cs index 22033324b655..ec1916274c12 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyAssignment_Get1.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyAssignment_Get1.cs @@ -193,11 +193,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyAssignment_GetViaIdentity.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyAssignment_GetViaIdentity.cs index 68d6687c9ca1..2b4dfa06d8ef 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyAssignment_GetViaIdentity.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyAssignment_GetViaIdentity.cs @@ -181,11 +181,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyAssignment_List.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyAssignment_List.cs index c55be1f76dd0..2e9260f33341 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyAssignment_List.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyAssignment_List.cs @@ -258,11 +258,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyAssignment_List1.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyAssignment_List1.cs index ec52c542f8d6..a5ece74247c2 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyAssignment_List1.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyAssignment_List1.cs @@ -326,11 +326,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyAssignment_List2.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyAssignment_List2.cs index 61f72803be0c..a9c2989725cf 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyAssignment_List2.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyAssignment_List2.cs @@ -242,11 +242,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyAssignment_List3.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyAssignment_List3.cs index 55f7bba6c37f..e5317e39498a 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyAssignment_List3.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyAssignment_List3.cs @@ -244,11 +244,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionBuilt_Get.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionBuilt_Get.cs index eb5836ca9511..5f8198271d3c 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionBuilt_Get.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionBuilt_Get.cs @@ -185,11 +185,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionBuilt_GetViaIdentity.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionBuilt_GetViaIdentity.cs index 144f8d83e5c1..7bac7ab0f0c9 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionBuilt_GetViaIdentity.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionBuilt_GetViaIdentity.cs @@ -179,11 +179,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionBuilt_List.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionBuilt_List.cs index 0208631b7537..43fea8aae634 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionBuilt_List.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionBuilt_List.cs @@ -220,11 +220,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersionBuilt_Get.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersionBuilt_Get.cs index ee58e2392285..c90cba9f3e9c 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersionBuilt_Get.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersionBuilt_Get.cs @@ -204,11 +204,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersionBuilt_List.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersionBuilt_List.cs index b3b62d3d421e..adb884a73abb 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersionBuilt_List.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersionBuilt_List.cs @@ -210,11 +210,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersionBuiltin_List.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersionBuiltin_List.cs index 0810cd0cf2bd..c83d5b763bef 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersionBuiltin_List.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersionBuiltin_List.cs @@ -179,11 +179,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersion_Get.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersion_Get.cs index 3fad0694d0ae..0dd3e99d54b5 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersion_Get.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersion_Get.cs @@ -223,11 +223,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersion_Get1.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersion_Get1.cs index 107e36667a44..1fdd551c5fdb 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersion_Get1.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersion_Get1.cs @@ -218,11 +218,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersion_List.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersion_List.cs index 4c34dde28b28..b2e779df56e0 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersion_List.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersion_List.cs @@ -193,11 +193,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersion_List1.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersion_List1.cs index c86cc53cfadb..bae0f758d613 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersion_List1.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersion_List1.cs @@ -198,11 +198,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersion_List2.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersion_List2.cs index 4513c388f788..f56f0051d481 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersion_List2.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersion_List2.cs @@ -229,11 +229,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersion_List3.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersion_List3.cs index 177ff4fd02a5..6759cf22ae91 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersion_List3.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinitionVersion_List3.cs @@ -225,11 +225,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinition_Get.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinition_Get.cs index f7c6f21b66b3..2feb6be47ff1 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinition_Get.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinition_Get.cs @@ -207,11 +207,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinition_Get1.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinition_Get1.cs index 359bc9793827..f9fe3962a7ca 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinition_Get1.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinition_Get1.cs @@ -208,11 +208,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinition_GetViaIdentity.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinition_GetViaIdentity.cs index 874959252634..a7b868d0f82c 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinition_GetViaIdentity.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinition_GetViaIdentity.cs @@ -181,11 +181,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinition_GetViaIdentity1.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinition_GetViaIdentity1.cs index 553d9315d58f..d30a3d3966d6 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinition_GetViaIdentity1.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinition_GetViaIdentity1.cs @@ -181,11 +181,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinition_List.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinition_List.cs index 7029ce033df9..094d4c37c003 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinition_List.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinition_List.cs @@ -243,11 +243,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinition_List1.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinition_List1.cs index 7b22c07b806c..848c6ccb344d 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinition_List1.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyDefinition_List1.cs @@ -244,11 +244,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyExemption_Get.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyExemption_Get.cs index 112f7a638e33..2084ecb1174e 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyExemption_Get.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyExemption_Get.cs @@ -206,11 +206,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyExemption_GetViaIdentity.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyExemption_GetViaIdentity.cs index 1c694e7d3b19..c9db482d7f43 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyExemption_GetViaIdentity.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyExemption_GetViaIdentity.cs @@ -181,11 +181,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyExemption_List.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyExemption_List.cs index 856995c8c324..b6f17ed7d343 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyExemption_List.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyExemption_List.cs @@ -226,11 +226,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyExemption_List1.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyExemption_List1.cs index 43b1f3c00b9d..60144a0ca34a 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyExemption_List1.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyExemption_List1.cs @@ -240,11 +240,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyExemption_List2.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyExemption_List2.cs index afd1cb8b0208..88042f019eb3 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyExemption_List2.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyExemption_List2.cs @@ -308,11 +308,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyExemption_List3.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyExemption_List3.cs index bf7ad2b2d448..16df6ad5bfac 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyExemption_List3.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicyExemption_List3.cs @@ -226,11 +226,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionBuilt_Get.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionBuilt_Get.cs index 5c9d493d3d1c..668133046007 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionBuilt_Get.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionBuilt_Get.cs @@ -187,11 +187,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionBuilt_GetViaIdentity.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionBuilt_GetViaIdentity.cs index 008b62e7d827..1db1b91046c5 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionBuilt_GetViaIdentity.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionBuilt_GetViaIdentity.cs @@ -181,11 +181,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionBuilt_List.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionBuilt_List.cs index 711221729716..da6a058ce344 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionBuilt_List.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionBuilt_List.cs @@ -219,11 +219,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersionBuilt_Get.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersionBuilt_Get.cs index aeb5bb384aaa..3e9fc2941e0e 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersionBuilt_Get.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersionBuilt_Get.cs @@ -204,11 +204,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersionBuilt_List.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersionBuilt_List.cs index cc5e0a24621b..63d8dd4d56c2 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersionBuilt_List.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersionBuilt_List.cs @@ -210,11 +210,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersionBuiltin_List.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersionBuiltin_List.cs index 1c190ba91be2..3e10924ef227 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersionBuiltin_List.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersionBuiltin_List.cs @@ -179,11 +179,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersion_Get.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersion_Get.cs index 414880d30e5f..a541a9ca63a2 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersion_Get.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersion_Get.cs @@ -223,11 +223,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersion_Get1.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersion_Get1.cs index 9db810036406..a070cd342719 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersion_Get1.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersion_Get1.cs @@ -218,11 +218,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersion_List.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersion_List.cs index d0a2f548c3e5..a6c947b82b92 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersion_List.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersion_List.cs @@ -193,11 +193,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersion_List1.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersion_List1.cs index 1bf723c3ebed..88d5f895b072 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersion_List1.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersion_List1.cs @@ -198,11 +198,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersion_List2.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersion_List2.cs index 0c48a70c0451..3729c11a9673 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersion_List2.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersion_List2.cs @@ -229,11 +229,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersion_List3.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersion_List3.cs index 88e9823b65d9..a0352c39ca73 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersion_List3.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinitionVersion_List3.cs @@ -225,11 +225,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinition_Get.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinition_Get.cs index f52b383eeeec..673aefa3d52e 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinition_Get.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinition_Get.cs @@ -207,11 +207,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinition_Get1.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinition_Get1.cs index 8377f78df73c..4c06afc7872c 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinition_Get1.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinition_Get1.cs @@ -208,11 +208,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinition_GetViaIdentity.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinition_GetViaIdentity.cs index 24e88621a926..fb667882e1b7 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinition_GetViaIdentity.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinition_GetViaIdentity.cs @@ -181,11 +181,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinition_GetViaIdentity1.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinition_GetViaIdentity1.cs index 3e374568a230..2ef9f0b96025 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinition_GetViaIdentity1.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinition_GetViaIdentity1.cs @@ -181,11 +181,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinition_List.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinition_List.cs index 3ff020030ed9..ba78dae4863b 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinition_List.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinition_List.cs @@ -243,11 +243,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinition_List1.cs b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinition_List1.cs index adc0039f79b6..202ecdc517fa 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinition_List1.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/GetAzPolicySetDefinition_List1.cs @@ -244,11 +244,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/NewAzPolicyAssignment_CreateExpanded.cs b/src/Resources/Policy.Autorest/generated/cmdlets/NewAzPolicyAssignment_CreateExpanded.cs index 23490dd02563..6387694851c9 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/NewAzPolicyAssignment_CreateExpanded.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/NewAzPolicyAssignment_CreateExpanded.cs @@ -365,11 +365,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } @@ -466,14 +474,15 @@ private void PreProcessManagedIdentityParameters() if (this.UserAssignedIdentity?.Length > 0) { // calculate UserAssignedIdentity + _parametersBody.IdentityUserAssignedIdentity.Clear(); foreach( var id in this.UserAssignedIdentity ) { _parametersBody.IdentityUserAssignedIdentity.Add(id, new Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.UserAssignedIdentitiesValue()); } } + // calculate IdentityType if (this.UserAssignedIdentity?.Length > 0) { - // calculate IdentityType if ("SystemAssigned".Equals(_parametersBody.IdentityType, StringComparison.InvariantCultureIgnoreCase)) { _parametersBody.IdentityType = "SystemAssigned,UserAssigned"; diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/NewAzPolicyAssignment_CreateExpanded1.cs b/src/Resources/Policy.Autorest/generated/cmdlets/NewAzPolicyAssignment_CreateExpanded1.cs index e896c5165a80..d95a9d0b17a9 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/NewAzPolicyAssignment_CreateExpanded1.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/NewAzPolicyAssignment_CreateExpanded1.cs @@ -352,11 +352,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } @@ -453,14 +461,15 @@ private void PreProcessManagedIdentityParameters() if (this.UserAssignedIdentity?.Length > 0) { // calculate UserAssignedIdentity + _parametersBody.IdentityUserAssignedIdentity.Clear(); foreach( var id in this.UserAssignedIdentity ) { _parametersBody.IdentityUserAssignedIdentity.Add(id, new Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.UserAssignedIdentitiesValue()); } } + // calculate IdentityType if (this.UserAssignedIdentity?.Length > 0) { - // calculate IdentityType if ("SystemAssigned".Equals(_parametersBody.IdentityType, StringComparison.InvariantCultureIgnoreCase)) { _parametersBody.IdentityType = "SystemAssigned,UserAssigned"; diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/NewAzPolicyDefinition_CreateExpanded.cs b/src/Resources/Policy.Autorest/generated/cmdlets/NewAzPolicyDefinition_CreateExpanded.cs index c5de448e64e9..dc73774d8fcb 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/NewAzPolicyDefinition_CreateExpanded.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/NewAzPolicyDefinition_CreateExpanded.cs @@ -327,11 +327,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/NewAzPolicyDefinition_CreateExpanded1.cs b/src/Resources/Policy.Autorest/generated/cmdlets/NewAzPolicyDefinition_CreateExpanded1.cs index d4d6fca821e4..a92010e68ec0 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/NewAzPolicyDefinition_CreateExpanded1.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/NewAzPolicyDefinition_CreateExpanded1.cs @@ -328,11 +328,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/NewAzPolicyExemption_CreateExpanded.cs b/src/Resources/Policy.Autorest/generated/cmdlets/NewAzPolicyExemption_CreateExpanded.cs index 7f19379d91e2..d0c5ed8562c5 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/NewAzPolicyExemption_CreateExpanded.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/NewAzPolicyExemption_CreateExpanded.cs @@ -347,11 +347,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/NewAzPolicySetDefinition_CreateExpanded.cs b/src/Resources/Policy.Autorest/generated/cmdlets/NewAzPolicySetDefinition_CreateExpanded.cs index 3df2f979388b..77354a31a0de 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/NewAzPolicySetDefinition_CreateExpanded.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/NewAzPolicySetDefinition_CreateExpanded.cs @@ -341,11 +341,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/NewAzPolicySetDefinition_CreateExpanded1.cs b/src/Resources/Policy.Autorest/generated/cmdlets/NewAzPolicySetDefinition_CreateExpanded1.cs index ef663903a4ec..a2c3b9095182 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/NewAzPolicySetDefinition_CreateExpanded1.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/NewAzPolicySetDefinition_CreateExpanded1.cs @@ -342,11 +342,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyAssignment_Delete.cs b/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyAssignment_Delete.cs index 5b5b0e9c77b0..d0a9b060e856 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyAssignment_Delete.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyAssignment_Delete.cs @@ -224,11 +224,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyAssignment_Delete1.cs b/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyAssignment_Delete1.cs index ba337f52846a..156d60f3fdf0 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyAssignment_Delete1.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyAssignment_Delete1.cs @@ -211,11 +211,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyAssignment_DeleteViaIdentity.cs b/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyAssignment_DeleteViaIdentity.cs index 66e4bd728bd6..2b0f698c7af0 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyAssignment_DeleteViaIdentity.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyAssignment_DeleteViaIdentity.cs @@ -199,11 +199,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyDefinition_Delete.cs b/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyDefinition_Delete.cs index 70f4dbadbbff..db75f178052b 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyDefinition_Delete.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyDefinition_Delete.cs @@ -222,11 +222,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyDefinition_Delete1.cs b/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyDefinition_Delete1.cs index cb1297907266..db931319f8e3 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyDefinition_Delete1.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyDefinition_Delete1.cs @@ -223,11 +223,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyDefinition_DeleteViaIdentity.cs b/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyDefinition_DeleteViaIdentity.cs index d83278f3f34a..e85dfbdb9f2d 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyDefinition_DeleteViaIdentity.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyDefinition_DeleteViaIdentity.cs @@ -196,11 +196,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyDefinition_DeleteViaIdentity1.cs b/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyDefinition_DeleteViaIdentity1.cs index 41ed1de8497f..c6430fd76fb6 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyDefinition_DeleteViaIdentity1.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyDefinition_DeleteViaIdentity1.cs @@ -196,11 +196,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyExemption_Delete.cs b/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyExemption_Delete.cs index 6e7b04383faa..391d387a29de 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyExemption_Delete.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyExemption_Delete.cs @@ -222,11 +222,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyExemption_DeleteViaIdentity.cs b/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyExemption_DeleteViaIdentity.cs index c05a581cdf03..7a51d03f4949 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyExemption_DeleteViaIdentity.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicyExemption_DeleteViaIdentity.cs @@ -197,11 +197,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicySetDefinition_Delete.cs b/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicySetDefinition_Delete.cs index 5eb568e1ccfd..0c1f7a89a734 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicySetDefinition_Delete.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicySetDefinition_Delete.cs @@ -222,11 +222,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicySetDefinition_Delete1.cs b/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicySetDefinition_Delete1.cs index 948e9454d8e6..9ade93f956b5 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicySetDefinition_Delete1.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicySetDefinition_Delete1.cs @@ -223,11 +223,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicySetDefinition_DeleteViaIdentity.cs b/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicySetDefinition_DeleteViaIdentity.cs index 9d09fb6a13f8..719808c53fce 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicySetDefinition_DeleteViaIdentity.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicySetDefinition_DeleteViaIdentity.cs @@ -196,11 +196,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicySetDefinition_DeleteViaIdentity1.cs b/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicySetDefinition_DeleteViaIdentity1.cs index fc60c117176c..c2a8a1f562ba 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicySetDefinition_DeleteViaIdentity1.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/RemoveAzPolicySetDefinition_DeleteViaIdentity1.cs @@ -196,11 +196,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/UpdateAzPolicyAssignment_UpdateExpanded.cs b/src/Resources/Policy.Autorest/generated/cmdlets/UpdateAzPolicyAssignment_UpdateExpanded.cs index 89c7c4d742f7..9d08f556d3b9 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/UpdateAzPolicyAssignment_UpdateExpanded.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/UpdateAzPolicyAssignment_UpdateExpanded.cs @@ -353,11 +353,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } @@ -448,6 +456,7 @@ private void PreProcessManagedIdentityParametersWithGetResult() if (this.UserAssignedIdentity?.Length > 0) { // calculate UserAssignedIdentity + _parametersBody.IdentityUserAssignedIdentity.Clear(); foreach( var id in this.UserAssignedIdentity ) { _parametersBody.IdentityUserAssignedIdentity.Add(id, new Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.UserAssignedIdentitiesValue()); diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/UpdateAzPolicyDefinition_UpdateExpanded.cs b/src/Resources/Policy.Autorest/generated/cmdlets/UpdateAzPolicyDefinition_UpdateExpanded.cs index 2ef4b9f59764..8a69f1b9e295 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/UpdateAzPolicyDefinition_UpdateExpanded.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/UpdateAzPolicyDefinition_UpdateExpanded.cs @@ -327,11 +327,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/UpdateAzPolicyDefinition_UpdateViaIdentityExpanded.cs b/src/Resources/Policy.Autorest/generated/cmdlets/UpdateAzPolicyDefinition_UpdateViaIdentityExpanded.cs index 3e459947ac53..68e2511568e0 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/UpdateAzPolicyDefinition_UpdateViaIdentityExpanded.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/UpdateAzPolicyDefinition_UpdateViaIdentityExpanded.cs @@ -300,11 +300,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/UpdateAzPolicyExemption_UpdateExpanded.cs b/src/Resources/Policy.Autorest/generated/cmdlets/UpdateAzPolicyExemption_UpdateExpanded.cs index 13872d18c42a..5dee641edd66 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/UpdateAzPolicyExemption_UpdateExpanded.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/UpdateAzPolicyExemption_UpdateExpanded.cs @@ -233,11 +233,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/UpdateAzPolicyExemption_UpdateViaIdentityExpanded.cs b/src/Resources/Policy.Autorest/generated/cmdlets/UpdateAzPolicyExemption_UpdateViaIdentityExpanded.cs index 63206d2b36aa..c093fe7b2172 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/UpdateAzPolicyExemption_UpdateViaIdentityExpanded.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/UpdateAzPolicyExemption_UpdateViaIdentityExpanded.cs @@ -208,11 +208,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/UpdateAzPolicySetDefinition_UpdateExpanded.cs b/src/Resources/Policy.Autorest/generated/cmdlets/UpdateAzPolicySetDefinition_UpdateExpanded.cs index 971d44f070cd..cdde0b17dc37 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/UpdateAzPolicySetDefinition_UpdateExpanded.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/UpdateAzPolicySetDefinition_UpdateExpanded.cs @@ -342,11 +342,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Policy.Autorest/generated/cmdlets/UpdateAzPolicySetDefinition_UpdateViaIdentityExpanded.cs b/src/Resources/Policy.Autorest/generated/cmdlets/UpdateAzPolicySetDefinition_UpdateViaIdentityExpanded.cs index c955d8fd45f2..1b5e354a4f5a 100644 --- a/src/Resources/Policy.Autorest/generated/cmdlets/UpdateAzPolicySetDefinition_UpdateViaIdentityExpanded.cs +++ b/src/Resources/Policy.Autorest/generated/cmdlets/UpdateAzPolicySetDefinition_UpdateViaIdentityExpanded.cs @@ -315,11 +315,19 @@ protected override void EndProcessing() var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Policy.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (!string.IsNullOrEmpty(sanitizedProperties)) + if (showSecretsWarning == "true") { - WriteWarning($"The output of cmdlet {invocationName ?? "Unknown"} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } } } } diff --git a/src/Resources/Resources/Az.Resources.psd1 b/src/Resources/Resources/Az.Resources.psd1 index 6e7c0640462a..a53e90054da9 100644 --- a/src/Resources/Resources/Az.Resources.psd1 +++ b/src/Resources/Resources/Az.Resources.psd1 @@ -3,7 +3,7 @@ # # Generated by: Microsoft Corporation # -# Generated on: 4/9/2024 +# Generated on: 4/12/2024 # @{ diff --git a/src/Resources/Resources/help/Az.Resources.md b/src/Resources/Resources/help/Az.Resources.md index d04a8ffe64d5..fbe6935cd31d 100644 --- a/src/Resources/Resources/help/Az.Resources.md +++ b/src/Resources/Resources/help/Az.Resources.md @@ -558,18 +558,6 @@ Updates managed application definition ### [Set-AzManagementGroupDeploymentStack](Set-AzManagementGroupDeploymentStack.md) Sets a new Management Group scoped Deployment Stack. -### [Set-AzPolicyAssignment](Set-AzPolicyAssignment.md) -Modifies a policy assignment. - -### [Set-AzPolicyDefinition](Set-AzPolicyDefinition.md) -Modifies a policy definition. - -### [Set-AzPolicyExemption](Set-AzPolicyExemption.md) -Modifies a policy exemption. - -### [Set-AzPolicySetDefinition](Set-AzPolicySetDefinition.md) -Modifies a policy set definition - ### [Set-AzResource](Set-AzResource.md) Modifies a resource.