diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/Az.ConnectedMachine.psm1 b/src/ConnectedMachine/ConnectedMachine.Autorest/Az.ConnectedMachine.psm1 index e837ea4375d7..8b9042a3806a 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/Az.ConnectedMachine.psm1 +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/Az.ConnectedMachine.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.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/exports/Connect-AzConnectedMachine.ps1 b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Connect-AzConnectedMachine.ps1 index 3f4219d84b09..341bd80be68d 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Connect-AzConnectedMachine.ps1 +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Connect-AzConnectedMachine.ps1 @@ -150,7 +150,13 @@ begin { __AllParameterSets = 'Az.ConnectedMachine.custom\Connect-AzConnectedMachine'; } if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Get-AzConnectedExtensionMetadata.ps1 b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Get-AzConnectedExtensionMetadata.ps1 index 4eea1b1a79c4..d4770333b836 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Get-AzConnectedExtensionMetadata.ps1 +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Get-AzConnectedExtensionMetadata.ps1 @@ -144,7 +144,13 @@ begin { List = 'Az.ConnectedMachine.private\Get-AzConnectedExtensionMetadata_List'; } if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Get-AzConnectedMachine.ps1 b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Get-AzConnectedMachine.ps1 index b07716dfa6ce..75660e1b641d 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Get-AzConnectedMachine.ps1 +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Get-AzConnectedMachine.ps1 @@ -145,7 +145,13 @@ begin { List1 = 'Az.ConnectedMachine.private\Get-AzConnectedMachine_List1'; } if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Get-AzConnectedMachineExtension.ps1 b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Get-AzConnectedMachineExtension.ps1 index 385a4663e4c1..c62ea1baa5f8 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Get-AzConnectedMachineExtension.ps1 +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Get-AzConnectedMachineExtension.ps1 @@ -145,7 +145,13 @@ begin { List = 'Az.ConnectedMachine.private\Get-AzConnectedMachineExtension_List'; } if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Get-AzConnectedMachineRunCommand.ps1 b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Get-AzConnectedMachineRunCommand.ps1 index 3e535c947e5d..91afb3e5ead3 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Get-AzConnectedMachineRunCommand.ps1 +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Get-AzConnectedMachineRunCommand.ps1 @@ -145,7 +145,13 @@ begin { List = 'Az.ConnectedMachine.private\Get-AzConnectedMachineRunCommand_List'; } if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Get-AzConnectedPrivateLinkScope.ps1 b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Get-AzConnectedPrivateLinkScope.ps1 index 72fef7f6a865..c6f064d5f7e9 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Get-AzConnectedPrivateLinkScope.ps1 +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Get-AzConnectedPrivateLinkScope.ps1 @@ -135,7 +135,13 @@ begin { List1 = 'Az.ConnectedMachine.private\Get-AzConnectedPrivateLinkScope_List1'; } if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Install-AzConnectedMachinePatch.ps1 b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Install-AzConnectedMachinePatch.ps1 index 4d95d7147630..2a44fd900b22 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Install-AzConnectedMachinePatch.ps1 +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Install-AzConnectedMachinePatch.ps1 @@ -249,7 +249,13 @@ begin { InstallViaIdentityExpanded = 'Az.ConnectedMachine.private\Install-AzConnectedMachinePatch_InstallViaIdentityExpanded'; } if (('InstallExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Invoke-AzConnectedAssessMachinePatch.ps1 b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Invoke-AzConnectedAssessMachinePatch.ps1 index f676c718be01..6a2228e068f3 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Invoke-AzConnectedAssessMachinePatch.ps1 +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Invoke-AzConnectedAssessMachinePatch.ps1 @@ -177,7 +177,13 @@ begin { AssessViaIdentity = 'Az.ConnectedMachine.private\Invoke-AzConnectedAssessMachinePatch_AssessViaIdentity'; } if (('Assess') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/New-AzConnectedMachineExtension.ps1 b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/New-AzConnectedMachineExtension.ps1 index f3d98de9143e..82fa5d42cc0f 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/New-AzConnectedMachineExtension.ps1 +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/New-AzConnectedMachineExtension.ps1 @@ -445,7 +445,13 @@ begin { CreateViaJsonString = 'Az.ConnectedMachine.private\New-AzConnectedMachineExtension_CreateViaJsonString'; } if (('Create', 'CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/New-AzConnectedMachineRunCommand.ps1 b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/New-AzConnectedMachineRunCommand.ps1 index 386c243b2d6b..e14ab227cd8b 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/New-AzConnectedMachineRunCommand.ps1 +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/New-AzConnectedMachineRunCommand.ps1 @@ -486,7 +486,13 @@ begin { ScriptLocalPath = 'Az.ConnectedMachine.custom\New-AzConnectedMachineRunCommand_ScriptLocalPath'; } if (('Create', 'CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString', 'ScriptLocalPath') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/New-AzConnectedPrivateLinkScope.ps1 b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/New-AzConnectedPrivateLinkScope.ps1 index 805da7d7747b..ebd8eb916005 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/New-AzConnectedPrivateLinkScope.ps1 +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/New-AzConnectedPrivateLinkScope.ps1 @@ -233,7 +233,13 @@ begin { CreateViaJsonString = 'Az.ConnectedMachine.private\New-AzConnectedPrivateLinkScope_CreateViaJsonString'; } if (('Create', 'CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/ProxyCmdletDefinitions.ps1 b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/ProxyCmdletDefinitions.ps1 index ad56bd4de228..fddf66848139 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -144,7 +144,13 @@ begin { List = 'Az.ConnectedMachine.private\Get-AzConnectedExtensionMetadata_List'; } if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -327,7 +333,13 @@ begin { List = 'Az.ConnectedMachine.private\Get-AzConnectedMachineExtension_List'; } if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -510,7 +522,13 @@ begin { List = 'Az.ConnectedMachine.private\Get-AzConnectedMachineRunCommand_List'; } if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -693,7 +711,13 @@ begin { List1 = 'Az.ConnectedMachine.private\Get-AzConnectedMachine_List1'; } if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -866,7 +890,13 @@ begin { List1 = 'Az.ConnectedMachine.private\Get-AzConnectedPrivateLinkScope_List1'; } if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -1153,7 +1183,13 @@ begin { InstallViaIdentityExpanded = 'Az.ConnectedMachine.private\Install-AzConnectedMachinePatch_InstallViaIdentityExpanded'; } if (('InstallExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -1368,7 +1404,13 @@ begin { AssessViaIdentity = 'Az.ConnectedMachine.private\Invoke-AzConnectedAssessMachinePatch_AssessViaIdentity'; } if (('Assess') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -1851,7 +1893,13 @@ begin { CreateViaJsonString = 'Az.ConnectedMachine.private\New-AzConnectedMachineExtension_CreateViaJsonString'; } if (('Create', 'CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -2375,7 +2423,13 @@ begin { ScriptLocalPath = 'Az.ConnectedMachine.custom\New-AzConnectedMachineRunCommand_ScriptLocalPath'; } if (('Create', 'CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString', 'ScriptLocalPath') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -2646,7 +2700,13 @@ begin { CreateViaJsonString = 'Az.ConnectedMachine.private\New-AzConnectedPrivateLinkScope_CreateViaJsonString'; } if (('Create', 'CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -2907,7 +2967,13 @@ begin { DeleteViaIdentityMachine = 'Az.ConnectedMachine.private\Remove-AzConnectedMachineExtension_DeleteViaIdentityMachine'; } if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -3166,7 +3232,13 @@ begin { DeleteViaIdentityMachine = 'Az.ConnectedMachine.private\Remove-AzConnectedMachineRunCommand_DeleteViaIdentityMachine'; } if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -3379,7 +3451,13 @@ begin { DeleteViaIdentity = 'Az.ConnectedMachine.private\Remove-AzConnectedMachine_DeleteViaIdentity'; } if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -3601,7 +3679,13 @@ begin { DeleteViaIdentity = 'Az.ConnectedMachine.private\Remove-AzConnectedPrivateLinkScope_DeleteViaIdentity'; } if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -3957,7 +4041,13 @@ begin { UpdateViaJsonString = 'Az.ConnectedMachine.private\Set-AzConnectedMachineExtension_UpdateViaJsonString'; } if (('Update', 'UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -4181,7 +4271,13 @@ begin { UpdateViaJsonString = 'Az.ConnectedMachine.private\Set-AzConnectedPrivateLinkScope_UpdateViaJsonString'; } if (('Update', 'UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -4451,7 +4547,13 @@ begin { UpgradeViaJsonString = 'Az.ConnectedMachine.private\Update-AzConnectedExtension_UpgradeViaJsonString'; } if (('Upgrade', 'UpgradeExpanded', 'UpgradeViaJsonFilePath', 'UpgradeViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -4866,7 +4968,13 @@ begin { UpdateViaJsonString = 'Az.ConnectedMachine.private\Update-AzConnectedMachineExtension_UpdateViaJsonString'; } if (('Update', 'UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -5331,7 +5439,13 @@ begin { UpdateViaIdentityMachineExpanded = 'Az.ConnectedMachine.private\Update-AzConnectedMachineRunCommand_UpdateViaIdentityMachineExpanded'; } if (('Update', 'UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -5711,7 +5825,13 @@ begin { UpdateViaJsonString = 'Az.ConnectedMachine.private\Update-AzConnectedMachine_UpdateViaJsonString'; } if (('Update', 'UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -5965,7 +6085,13 @@ begin { UpdateViaJsonString = 'Az.ConnectedMachine.private\Update-AzConnectedPrivateLinkScopeTag_UpdateViaJsonString'; } if (('Update', 'UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -6153,7 +6279,13 @@ begin { __AllParameterSets = 'Az.ConnectedMachine.custom\Connect-AzConnectedMachine'; } if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedMachine.ps1 b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedMachine.ps1 index 5755b2c4df80..c5b8f3e35ad3 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedMachine.ps1 +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedMachine.ps1 @@ -175,7 +175,13 @@ begin { DeleteViaIdentity = 'Az.ConnectedMachine.private\Remove-AzConnectedMachine_DeleteViaIdentity'; } if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedMachineExtension.ps1 b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedMachineExtension.ps1 index 325cff2f8057..6ba5c0145a21 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedMachineExtension.ps1 +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedMachineExtension.ps1 @@ -223,7 +223,13 @@ begin { DeleteViaIdentityMachine = 'Az.ConnectedMachine.private\Remove-AzConnectedMachineExtension_DeleteViaIdentityMachine'; } if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedMachineRunCommand.ps1 b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedMachineRunCommand.ps1 index b5fcd2be076e..4a6471801d37 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedMachineRunCommand.ps1 +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedMachineRunCommand.ps1 @@ -221,7 +221,13 @@ begin { DeleteViaIdentityMachine = 'Az.ConnectedMachine.private\Remove-AzConnectedMachineRunCommand_DeleteViaIdentityMachine'; } if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedPrivateLinkScope.ps1 b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedPrivateLinkScope.ps1 index 9c9148a7737f..98359cf501d8 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedPrivateLinkScope.ps1 +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedPrivateLinkScope.ps1 @@ -184,7 +184,13 @@ begin { DeleteViaIdentity = 'Az.ConnectedMachine.private\Remove-AzConnectedPrivateLinkScope_DeleteViaIdentity'; } if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Set-AzConnectedMachineExtension.ps1 b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Set-AzConnectedMachineExtension.ps1 index 60c088d23b1a..2e104aa33843 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Set-AzConnectedMachineExtension.ps1 +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Set-AzConnectedMachineExtension.ps1 @@ -318,7 +318,13 @@ begin { UpdateViaJsonString = 'Az.ConnectedMachine.private\Set-AzConnectedMachineExtension_UpdateViaJsonString'; } if (('Update', 'UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Set-AzConnectedPrivateLinkScope.ps1 b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Set-AzConnectedPrivateLinkScope.ps1 index dea0707f6104..0db601640f76 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Set-AzConnectedPrivateLinkScope.ps1 +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Set-AzConnectedPrivateLinkScope.ps1 @@ -186,7 +186,13 @@ begin { UpdateViaJsonString = 'Az.ConnectedMachine.private\Set-AzConnectedPrivateLinkScope_UpdateViaJsonString'; } if (('Update', 'UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedExtension.ps1 b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedExtension.ps1 index fc3c574e159b..32ec8b7c9b06 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedExtension.ps1 +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedExtension.ps1 @@ -232,7 +232,13 @@ begin { UpgradeViaJsonString = 'Az.ConnectedMachine.private\Update-AzConnectedExtension_UpgradeViaJsonString'; } if (('Upgrade', 'UpgradeExpanded', 'UpgradeViaJsonFilePath', 'UpgradeViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedMachine.ps1 b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedMachine.ps1 index 54a729ae4ba6..7ce147c6cec6 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedMachine.ps1 +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedMachine.ps1 @@ -342,7 +342,13 @@ begin { UpdateViaJsonString = 'Az.ConnectedMachine.private\Update-AzConnectedMachine_UpdateViaJsonString'; } if (('Update', 'UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedMachineExtension.ps1 b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedMachineExtension.ps1 index eff579a5934e..f00c41047e07 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedMachineExtension.ps1 +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedMachineExtension.ps1 @@ -377,7 +377,13 @@ begin { UpdateViaJsonString = 'Az.ConnectedMachine.private\Update-AzConnectedMachineExtension_UpdateViaJsonString'; } if (('Update', 'UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedMachineRunCommand.ps1 b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedMachineRunCommand.ps1 index 1e291aaa7391..a928b913e973 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedMachineRunCommand.ps1 +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedMachineRunCommand.ps1 @@ -427,7 +427,13 @@ begin { UpdateViaIdentityMachineExpanded = 'Az.ConnectedMachine.private\Update-AzConnectedMachineRunCommand_UpdateViaIdentityMachineExpanded'; } if (('Update', 'UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedPrivateLinkScopeTag.ps1 b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedPrivateLinkScopeTag.ps1 index 25ac3912df38..efc5f2e6957b 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedPrivateLinkScopeTag.ps1 +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedPrivateLinkScopeTag.ps1 @@ -216,7 +216,13 @@ begin { UpdateViaJsonString = 'Az.ConnectedMachine.private\Update-AzConnectedPrivateLinkScopeTag_UpdateViaJsonString'; } if (('Update', 'UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/Module.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/Module.cs index da07ff8e945d..b23b733cad95 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/Module.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/Module.cs @@ -17,6 +17,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine 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 @@ -59,6 +61,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; } + /// the singleton of this module class public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module Instance { get { if (_instance == null) { lock (_singletonLock) { if (_instance == null) { _instance = new Module(); }}} return _instance; } } @@ -77,6 +82,9 @@ public partial class Module /// The ResourceID for this module (azure arm). public string ResourceId => @"Az.ConnectedMachine"; + /// 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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedExtensionMetadata_Get.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedExtensionMetadata_Get.cs index dc788aae3ab7..c72de3c7f187 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedExtensionMetadata_Get.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedExtensionMetadata_Get.cs @@ -248,6 +248,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// @@ -421,6 +431,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedExtensionMetadata_List.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedExtensionMetadata_List.cs index c1ab95ee619a..fa728204e7f0 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedExtensionMetadata_List.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedExtensionMetadata_List.cs @@ -232,6 +232,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// @@ -405,6 +415,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachineExtension_Get.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachineExtension_Get.cs index 6726c973a56b..1a8330ce760b 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachineExtension_Get.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachineExtension_Get.cs @@ -232,6 +232,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// @@ -405,6 +415,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachineExtension_List.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachineExtension_List.cs index 1d8ad6b7fe98..42106356e70b 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachineExtension_List.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachineExtension_List.cs @@ -238,6 +238,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// @@ -411,6 +421,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachineRunCommand_Get.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachineRunCommand_Get.cs index c51431aca91c..eca276d632ae 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachineRunCommand_Get.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachineRunCommand_Get.cs @@ -232,6 +232,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// @@ -405,6 +415,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachineRunCommand_List.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachineRunCommand_List.cs index d321e99e22a0..a3c0fefe7e7c 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachineRunCommand_List.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachineRunCommand_List.cs @@ -238,6 +238,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// @@ -411,6 +421,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachine_Get.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachine_Get.cs index dad0398d1c43..eee40ba87f0c 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachine_Get.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachine_Get.cs @@ -235,6 +235,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// @@ -408,6 +418,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachine_List.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachine_List.cs index 530cd97b0738..e7cd1e3e273c 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachine_List.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachine_List.cs @@ -227,6 +227,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// @@ -400,6 +410,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachine_List1.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachine_List1.cs index 176cb38a0503..6b498ae03a1b 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachine_List1.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachine_List1.cs @@ -195,6 +195,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// @@ -368,6 +378,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedOperation_List.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedOperation_List.cs index 70cb3a738f5d..c8134700fefb 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedOperation_List.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedOperation_List.cs @@ -168,6 +168,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// @@ -338,6 +348,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedPrivateLinkScope_Get.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedPrivateLinkScope_Get.cs index 645efc811cd5..7339348b0830 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedPrivateLinkScope_Get.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedPrivateLinkScope_Get.cs @@ -218,6 +218,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// @@ -391,6 +401,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedPrivateLinkScope_List.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedPrivateLinkScope_List.cs index 6096f68ae6af..fbbefbd54f06 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedPrivateLinkScope_List.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedPrivateLinkScope_List.cs @@ -192,6 +192,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// @@ -365,6 +375,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedPrivateLinkScope_List1.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedPrivateLinkScope_List1.cs index 55f964647817..7094759992e7 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedPrivateLinkScope_List1.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedPrivateLinkScope_List1.cs @@ -210,6 +210,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// @@ -383,6 +393,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_InstallExpanded.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_InstallExpanded.cs index c7071a6d4423..7c552898b26e 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_InstallExpanded.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_InstallExpanded.cs @@ -386,6 +386,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// @@ -605,6 +615,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_InstallViaIdentityExpanded.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_InstallViaIdentityExpanded.cs index 9918e2e26f53..7ae23fd48c17 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_InstallViaIdentityExpanded.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_InstallViaIdentityExpanded.cs @@ -342,6 +342,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// @@ -581,6 +591,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InvokeAzConnectedAssessMachinePatch_Assess.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InvokeAzConnectedAssessMachinePatch_Assess.cs index c6923d5797c3..f9ff0eee987a 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InvokeAzConnectedAssessMachinePatch_Assess.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InvokeAzConnectedAssessMachinePatch_Assess.cs @@ -254,6 +254,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// @@ -473,6 +483,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InvokeAzConnectedAssessMachinePatch_AssessViaIdentity.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InvokeAzConnectedAssessMachinePatch_AssessViaIdentity.cs index 1279268ca038..abfbec5c69e6 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InvokeAzConnectedAssessMachinePatch_AssessViaIdentity.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InvokeAzConnectedAssessMachinePatch_AssessViaIdentity.cs @@ -208,6 +208,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// @@ -447,6 +457,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_Create.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_Create.cs index 115bb214ad33..088691d039fa 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_Create.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_Create.cs @@ -284,6 +284,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -503,6 +513,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateExpanded.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateExpanded.cs index 89b603b9ab66..2c174958f0eb 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateExpanded.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateExpanded.cs @@ -490,6 +490,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -709,6 +719,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentity.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentity.cs index 064c85eed09a..2242a0050656 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentity.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentity.cs @@ -223,6 +223,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -466,6 +476,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentityExpanded.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentityExpanded.cs index 43d568e46af8..5dc472c96c97 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentityExpanded.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentityExpanded.cs @@ -431,6 +431,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -674,6 +684,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentityMachine.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentityMachine.cs index 93a69f806f65..d2baa3aa67e7 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentityMachine.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentityMachine.cs @@ -238,6 +238,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -478,6 +488,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentityMachineExpanded.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentityMachineExpanded.cs index 0fef79bd38d6..0bd0d9673ed5 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentityMachineExpanded.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentityMachineExpanded.cs @@ -446,6 +446,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -687,6 +697,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaJsonFilePath.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaJsonFilePath.cs index 5df62f910fe9..8411ac1a0ea2 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaJsonFilePath.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaJsonFilePath.cs @@ -286,6 +286,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -505,6 +515,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaJsonString.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaJsonString.cs index 7ed46d9150fc..245456993df5 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaJsonString.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaJsonString.cs @@ -284,6 +284,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -503,6 +513,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_Create.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_Create.cs index 4b581e83ef3e..3feaa1150a19 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_Create.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_Create.cs @@ -284,6 +284,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -503,6 +513,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateExpanded.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateExpanded.cs index 34d5f5af5dde..f02696d674d3 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateExpanded.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateExpanded.cs @@ -513,6 +513,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -732,6 +742,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaIdentity.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaIdentity.cs index d464004f7a30..65010cc3b6d5 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaIdentity.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaIdentity.cs @@ -223,6 +223,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -466,6 +476,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaIdentityExpanded.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaIdentityExpanded.cs index e68f6fd754c0..3ac2fe37ecdf 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaIdentityExpanded.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaIdentityExpanded.cs @@ -454,6 +454,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -697,6 +707,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaIdentityMachine.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaIdentityMachine.cs index 1e424a3536de..131851d3379e 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaIdentityMachine.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaIdentityMachine.cs @@ -240,6 +240,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -480,6 +490,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaIdentityMachineExpanded.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaIdentityMachineExpanded.cs index 541852c6e544..1eb29893e17d 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaIdentityMachineExpanded.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaIdentityMachineExpanded.cs @@ -469,6 +469,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -710,6 +720,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaJsonFilePath.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaJsonFilePath.cs index 1fe3a76cdcf7..b4b0969aab08 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaJsonFilePath.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaJsonFilePath.cs @@ -286,6 +286,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -505,6 +515,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaJsonString.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaJsonString.cs index 1e1c4ba6d466..51dc2aa2a03c 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaJsonString.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaJsonString.cs @@ -284,6 +284,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -503,6 +513,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_Create.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_Create.cs index 15feece35618..338723a1de3d 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_Create.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_Create.cs @@ -247,6 +247,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -420,6 +430,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Models.IHybridComputePrivateLinkScope diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateExpanded.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateExpanded.cs index 8fb60501b50e..5f26352989d2 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateExpanded.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateExpanded.cs @@ -277,6 +277,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -450,6 +460,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Models.IHybridComputePrivateLinkScope diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaIdentity.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaIdentity.cs index 40fcfa7f2321..df0f50a696fd 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaIdentity.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaIdentity.cs @@ -204,6 +204,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -397,6 +407,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Models.IHybridComputePrivateLinkScope diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaIdentityExpanded.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaIdentityExpanded.cs index ca9d7cb51a0d..fba1dd111490 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaIdentityExpanded.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaIdentityExpanded.cs @@ -234,6 +234,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -427,6 +437,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Models.IHybridComputePrivateLinkScope diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaJsonFilePath.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaJsonFilePath.cs index 5d229a2292df..5e454f3ebf6b 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaJsonFilePath.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaJsonFilePath.cs @@ -249,6 +249,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -422,6 +432,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Models.IHybridComputePrivateLinkScope diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaJsonString.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaJsonString.cs index 9416b6658846..9ce0e6409f8d 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaJsonString.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaJsonString.cs @@ -247,6 +247,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -420,6 +430,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Models.IHybridComputePrivateLinkScope diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineExtension_Delete.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineExtension_Delete.cs index 3e3365ec826a..2593896d0ddd 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineExtension_Delete.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineExtension_Delete.cs @@ -284,6 +284,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -503,6 +513,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineExtension_DeleteViaIdentity.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineExtension_DeleteViaIdentity.cs index 0155e22200fe..f754bbeb14e5 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineExtension_DeleteViaIdentity.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineExtension_DeleteViaIdentity.cs @@ -223,6 +223,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -466,6 +476,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineExtension_DeleteViaIdentityMachine.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineExtension_DeleteViaIdentityMachine.cs index 2c0baf7f3d4e..6604766115d0 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineExtension_DeleteViaIdentityMachine.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineExtension_DeleteViaIdentityMachine.cs @@ -240,6 +240,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -480,6 +490,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineRunCommand_Delete.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineRunCommand_Delete.cs index 3e84e6c43263..c249a97bc391 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineRunCommand_Delete.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineRunCommand_Delete.cs @@ -284,6 +284,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -503,6 +513,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineRunCommand_DeleteViaIdentity.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineRunCommand_DeleteViaIdentity.cs index 6f5ae395d24b..93eadacd00ce 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineRunCommand_DeleteViaIdentity.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineRunCommand_DeleteViaIdentity.cs @@ -223,6 +223,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -466,6 +476,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineRunCommand_DeleteViaIdentityMachine.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineRunCommand_DeleteViaIdentityMachine.cs index c48148f35e1d..95e617c52f70 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineRunCommand_DeleteViaIdentityMachine.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineRunCommand_DeleteViaIdentityMachine.cs @@ -240,6 +240,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -480,6 +490,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachine_Delete.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachine_Delete.cs index b026f254f95a..230448a4a325 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachine_Delete.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachine_Delete.cs @@ -234,6 +234,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -407,6 +417,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachine_DeleteViaIdentity.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachine_DeleteViaIdentity.cs index 20b3234acc95..28f30ec919ff 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachine_DeleteViaIdentity.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachine_DeleteViaIdentity.cs @@ -190,6 +190,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -383,6 +393,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedPrivateLinkScope_Delete.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedPrivateLinkScope_Delete.cs index 69736c78e12e..e49f660a4ec2 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedPrivateLinkScope_Delete.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedPrivateLinkScope_Delete.cs @@ -269,6 +269,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -488,6 +498,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedPrivateLinkScope_DeleteViaIdentity.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedPrivateLinkScope_DeleteViaIdentity.cs index aa4b8cbfd3b3..c7d780386052 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedPrivateLinkScope_DeleteViaIdentity.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedPrivateLinkScope_DeleteViaIdentity.cs @@ -223,6 +223,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -462,6 +472,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_Update.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_Update.cs index 340677cf0f59..7506d438de35 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_Update.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_Update.cs @@ -284,6 +284,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -503,6 +513,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_UpdateExpanded.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_UpdateExpanded.cs index 46353d7ecf03..a5c429168d41 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_UpdateExpanded.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_UpdateExpanded.cs @@ -490,6 +490,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -709,6 +719,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_UpdateViaJsonFilePath.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_UpdateViaJsonFilePath.cs index 57a945c1ad24..b4ff1338f66f 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_UpdateViaJsonFilePath.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_UpdateViaJsonFilePath.cs @@ -286,6 +286,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -505,6 +515,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_UpdateViaJsonString.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_UpdateViaJsonString.cs index f39cc988ee85..fe4df88d65c3 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_UpdateViaJsonString.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_UpdateViaJsonString.cs @@ -284,6 +284,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -503,6 +513,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_Update.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_Update.cs index 63a9feda4bf2..0f6676c1bedf 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_Update.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_Update.cs @@ -247,6 +247,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -420,6 +430,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Models.IHybridComputePrivateLinkScope diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_UpdateExpanded.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_UpdateExpanded.cs index 49dcccf44b42..aa98f7af99d8 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_UpdateExpanded.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_UpdateExpanded.cs @@ -277,6 +277,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -450,6 +460,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Models.IHybridComputePrivateLinkScope diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_UpdateViaJsonFilePath.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_UpdateViaJsonFilePath.cs index c4171760c823..194116e25230 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_UpdateViaJsonFilePath.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_UpdateViaJsonFilePath.cs @@ -249,6 +249,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -422,6 +432,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Models.IHybridComputePrivateLinkScope diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_UpdateViaJsonString.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_UpdateViaJsonString.cs index d06f59406e60..4226fa4ab5e7 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_UpdateViaJsonString.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_UpdateViaJsonString.cs @@ -247,6 +247,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -420,6 +430,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Models.IHybridComputePrivateLinkScope diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_Upgrade.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_Upgrade.cs index 2ee51184c6ff..21311c4d55ce 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_Upgrade.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_Upgrade.cs @@ -274,6 +274,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -493,6 +503,21 @@ public UpdateAzConnectedExtension_Upgrade() } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeExpanded.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeExpanded.cs index 2d5677f7b728..52724b9c2002 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeExpanded.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeExpanded.cs @@ -275,6 +275,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -494,6 +504,21 @@ public UpdateAzConnectedExtension_UpgradeExpanded() } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaIdentity.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaIdentity.cs index fd5146bc3f7d..37ced787f1fc 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaIdentity.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaIdentity.cs @@ -228,6 +228,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -467,6 +477,21 @@ public UpdateAzConnectedExtension_UpgradeViaIdentity() } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaIdentityExpanded.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaIdentityExpanded.cs index 00084eeb5b13..41b50c1aa65c 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaIdentityExpanded.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaIdentityExpanded.cs @@ -229,6 +229,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -468,6 +478,21 @@ public UpdateAzConnectedExtension_UpgradeViaIdentityExpanded() } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaJsonFilePath.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaJsonFilePath.cs index 0134caadac42..193c547f7afe 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaJsonFilePath.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaJsonFilePath.cs @@ -276,6 +276,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -495,6 +505,21 @@ public UpdateAzConnectedExtension_UpgradeViaJsonFilePath() } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaJsonString.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaJsonString.cs index ef374e1c9a79..d6da58003ecf 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaJsonString.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaJsonString.cs @@ -274,6 +274,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -493,6 +503,21 @@ public UpdateAzConnectedExtension_UpgradeViaJsonString() } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_Update.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_Update.cs index e5e9a01a2b28..0419659537a0 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_Update.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_Update.cs @@ -284,6 +284,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -503,6 +513,21 @@ public UpdateAzConnectedMachineExtension_Update() } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateExpanded.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateExpanded.cs index 8985232c50d4..f32467fba9a1 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateExpanded.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateExpanded.cs @@ -386,6 +386,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -605,6 +615,21 @@ public UpdateAzConnectedMachineExtension_UpdateExpanded() } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentity.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentity.cs index 26b7b9d64fd3..29f77dd4bdca 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentity.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentity.cs @@ -223,6 +223,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -466,6 +476,21 @@ public UpdateAzConnectedMachineExtension_UpdateViaIdentity() } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentityExpanded.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentityExpanded.cs index 0538518ad6d4..b91812793652 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentityExpanded.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentityExpanded.cs @@ -327,6 +327,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -570,6 +580,21 @@ public UpdateAzConnectedMachineExtension_UpdateViaIdentityExpanded() } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentityMachine.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentityMachine.cs index fa0acf4db741..cd099614377d 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentityMachine.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentityMachine.cs @@ -240,6 +240,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -480,6 +490,21 @@ public UpdateAzConnectedMachineExtension_UpdateViaIdentityMachine() } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentityMachineExpanded.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentityMachineExpanded.cs index ef5d116265ad..0ad21fd4c26a 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentityMachineExpanded.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentityMachineExpanded.cs @@ -342,6 +342,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -583,6 +593,21 @@ public UpdateAzConnectedMachineExtension_UpdateViaIdentityMachineExpanded() } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaJsonFilePath.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaJsonFilePath.cs index 68de1eae797e..c408a0dd1f5f 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaJsonFilePath.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaJsonFilePath.cs @@ -286,6 +286,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -505,6 +515,21 @@ public UpdateAzConnectedMachineExtension_UpdateViaJsonFilePath() } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaJsonString.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaJsonString.cs index 6268c5d02214..babfef424167 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaJsonString.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaJsonString.cs @@ -284,6 +284,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -503,6 +513,21 @@ public UpdateAzConnectedMachineExtension_UpdateViaJsonString() } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_Update.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_Update.cs index a251db2424f4..b800c651abca 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_Update.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_Update.cs @@ -284,6 +284,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -513,6 +523,21 @@ private void UpdateRunCommandProperty() } } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateExpanded.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateExpanded.cs index 412efdf93492..959c704e8fad 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateExpanded.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateExpanded.cs @@ -498,6 +498,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -795,6 +805,21 @@ private void Update_runCommandPropertiesBody() } } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateViaIdentity.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateViaIdentity.cs index 45ad5851f46b..a4b5960e04be 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateViaIdentity.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateViaIdentity.cs @@ -223,6 +223,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -478,6 +488,21 @@ private void UpdateRunCommandProperty() } } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateViaIdentityExpanded.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateViaIdentityExpanded.cs index 04f04bf11189..8caafc175d31 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateViaIdentityExpanded.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateViaIdentityExpanded.cs @@ -439,6 +439,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -762,6 +772,21 @@ private void Update_runCommandPropertiesBody() } } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateViaIdentityMachine.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateViaIdentityMachine.cs index d50362367617..904c57f36f22 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateViaIdentityMachine.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateViaIdentityMachine.cs @@ -240,6 +240,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -492,6 +502,21 @@ private void UpdateRunCommandProperty() } } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateViaIdentityMachineExpanded.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateViaIdentityMachineExpanded.cs index 4f776a44dece..666fd55b9929 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateViaIdentityMachineExpanded.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateViaIdentityMachineExpanded.cs @@ -454,6 +454,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -775,6 +785,21 @@ private void Update_runCommandPropertiesBody() } } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_Update.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_Update.cs index 0764d1c03a6d..4028ce06aade 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_Update.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_Update.cs @@ -233,6 +233,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -406,6 +416,21 @@ public UpdateAzConnectedMachine_Update() } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateExpanded.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateExpanded.cs index 96847a96b9e4..0b4dc319dd34 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateExpanded.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateExpanded.cs @@ -409,6 +409,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -582,6 +592,21 @@ public UpdateAzConnectedMachine_UpdateExpanded() } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaIdentity.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaIdentity.cs index 01003ef9cc8a..fc5429036a42 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaIdentity.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaIdentity.cs @@ -189,6 +189,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -382,6 +392,21 @@ public UpdateAzConnectedMachine_UpdateViaIdentity() } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaIdentityExpanded.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaIdentityExpanded.cs index c019abd66e0b..9069df8ce4d3 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaIdentityExpanded.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaIdentityExpanded.cs @@ -365,6 +365,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -558,6 +568,21 @@ public UpdateAzConnectedMachine_UpdateViaIdentityExpanded() } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaJsonFilePath.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaJsonFilePath.cs index a55933b1a29e..e2c7f9844f79 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaJsonFilePath.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaJsonFilePath.cs @@ -235,6 +235,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -408,6 +418,21 @@ public UpdateAzConnectedMachine_UpdateViaJsonFilePath() } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaJsonString.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaJsonString.cs index 203f88a614e1..881d0d743ffb 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaJsonString.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaJsonString.cs @@ -233,6 +233,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -406,6 +416,21 @@ public UpdateAzConnectedMachine_UpdateViaJsonString() } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_Update.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_Update.cs index daf76d630d16..4b51f5cab167 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_Update.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_Update.cs @@ -236,6 +236,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -409,6 +419,21 @@ public UpdateAzConnectedPrivateLinkScopeTag_Update() } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateExpanded.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateExpanded.cs index 3befed8039d4..b31191b620bc 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateExpanded.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateExpanded.cs @@ -237,6 +237,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -410,6 +420,21 @@ public UpdateAzConnectedPrivateLinkScopeTag_UpdateExpanded() } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaIdentity.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaIdentity.cs index 60b9ceaba5c4..9ae83bc14c70 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaIdentity.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaIdentity.cs @@ -193,6 +193,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -386,6 +396,21 @@ public UpdateAzConnectedPrivateLinkScopeTag_UpdateViaIdentity() } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaIdentityExpanded.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaIdentityExpanded.cs index cbad4beebbbd..9b0f04ec8527 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaIdentityExpanded.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaIdentityExpanded.cs @@ -194,6 +194,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -388,6 +398,21 @@ public UpdateAzConnectedPrivateLinkScopeTag_UpdateViaIdentityExpanded() } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaJsonFilePath.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaJsonFilePath.cs index 9ff3b3124a57..92644deb9262 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaJsonFilePath.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaJsonFilePath.cs @@ -236,6 +236,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -409,6 +419,21 @@ public UpdateAzConnectedPrivateLinkScopeTag_UpdateViaJsonFilePath() } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaJsonString.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaJsonString.cs index d18e70246415..eb5ee50a7bb5 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaJsonString.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaJsonString.cs @@ -234,6 +234,16 @@ protected override void EndProcessing() // Flush buffer WriteObject(_firstResponse); } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (!string.IsNullOrEmpty(sanitizedProperties)) + { + 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"); + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -407,6 +417,21 @@ public UpdateAzConnectedPrivateLinkScopeTag_UpdateViaJsonString() } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs index 34637c635fc1..f518493446d1 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -12,44 +12,65 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell { - [Cmdlet(VerbsData.Export, "TestStub")] - [DoNotExport] - public class ExportTestStub : PSCmdlet - { - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string ModuleName { get; set; } - - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string ExportsFolder { get; set; } - - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string OutputFolder { get; set; } - - [Parameter] - public SwitchParameter IncludeGenerated { get; set; } - - protected override void ProcessRecord() + [Cmdlet(VerbsData.Export, "TestStub")] + [DoNotExport] + public class ExportTestStub : PSCmdlet { - try - { - if (!Directory.Exists(ExportsFolder)) - { - throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); - } + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ModuleName { get; set; } - var exportDirectories = Directory.GetDirectories(ExportsFolder); - if (!exportDirectories.Any()) - { - exportDirectories = new[] { ExportsFolder }; - } - var utilFile = Path.Combine(OutputFolder, "utils.ps1"); - if (!File.Exists(utilFile)) + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + [Parameter] + public SwitchParameter IncludeGenerated { get; set; } + + protected override void ProcessRecord() { - var sc = new StringBuilder(); - sc.AppendLine(@"function RandomString([bool]$allChars, [int32]$len) { + try + { + if (!Directory.Exists(ExportsFolder)) + { + throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); + } + + var exportDirectories = Directory.GetDirectories(ExportsFolder); + if (!exportDirectories.Any()) + { + exportDirectories = new[] { ExportsFolder }; + } + /*var loadEnvFile = Path.Combine(OutputFolder, "loadEnv.ps1"); + if (!File.Exists(loadEnvFile)) + { + var sc = new StringBuilder(); + sc.AppendLine(@" +$envFile = 'env.json' +if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' +} + +if (Test-Path -Path (Join-Path $PSScriptRoot $envFile)) { + $envFilePath = Join-Path $PSScriptRoot $envFile +} else { + $envFilePath = Join-Path $PSScriptRoot '..\$envFile' +} +$env = @{} +if (Test-Path -Path $envFilePath) { + $env = Get-Content (Join-Path $PSScriptRoot $envFile) | ConvertFrom-Json +}"); + File.WriteAllText(loadEnvFile, sc.ToString()); + }*/ + var utilFile = Path.Combine(OutputFolder, "utils.ps1"); + if (!File.Exists(utilFile)) + { + var sc = new StringBuilder(); + sc.AppendLine(@"function RandomString([bool]$allChars, [int32]$len) { if ($allChars) { return -join ((33..126) | Get-Random -Count $len | % {[char]$_}) } else { @@ -105,37 +126,40 @@ function cleanupEnv() { # Clean resources you create for testing } "); - File.WriteAllText(utilFile, sc.ToString()); - } - foreach (var exportDirectory in exportDirectories) - { - var outputFolder = OutputFolder; - if (exportDirectory != ExportsFolder) - { - outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); - Directory.CreateDirectory(outputFolder); - } - - var variantGroups = GetScriptCmdlets(exportDirectory) - .SelectMany(fi => fi.ToVariants()) - .Where(v => !v.IsDoNotExport) - .GroupBy(v => v.CmdletName) - .Select(vg => new VariantGroup(ModuleName, vg.Key, vg.Select(v => v).ToArray(), outputFolder, isTest: true)) - .Where(vtg => !File.Exists(vtg.FilePath) && (IncludeGenerated || !vtg.IsGenerated)); - - foreach (var variantGroup in variantGroups) - { - var sb = new StringBuilder(); - sb.AppendLine($"if(($null -eq $TestName) -or ($TestName -contains '{variantGroup.CmdletName}'))"); - sb.AppendLine(@"{ + File.WriteAllText(utilFile, sc.ToString()); + } + + + + foreach (var exportDirectory in exportDirectories) + { + var outputFolder = OutputFolder; + if (exportDirectory != ExportsFolder) + { + outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); + Directory.CreateDirectory(outputFolder); + } + + var variantGroups = GetScriptCmdlets(exportDirectory) + .SelectMany(fi => fi.ToVariants()) + .Where(v => !v.IsDoNotExport) + .GroupBy(v => v.CmdletName) + .Select(vg => new VariantGroup(ModuleName, vg.Key, vg.Select(v => v).ToArray(), outputFolder, isTest: true)) + .Where(vtg => !File.Exists(vtg.FilePath) && (IncludeGenerated || !vtg.IsGenerated)); + + foreach (var variantGroup in variantGroups) + { + var sb = new StringBuilder(); + sb.AppendLine($"if(($null -eq $TestName) -or ($TestName -contains '{variantGroup.CmdletName}'))"); + sb.AppendLine(@"{ $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' if (-Not (Test-Path -Path $loadEnvPath)) { $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' } . ($loadEnvPath)" -); - sb.AppendLine($@" $TestRecordingFile = Join-Path $PSScriptRoot '{variantGroup.CmdletName}.Recording.json'"); - sb.AppendLine(@" $currentPath = $PSScriptRoot + ); + sb.AppendLine($@" $TestRecordingFile = Join-Path $PSScriptRoot '{variantGroup.CmdletName}.Recording.json'"); + sb.AppendLine(@" $currentPath = $PSScriptRoot while(-not $mockingPath) { $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File $currentPath = Split-Path -Path $currentPath -Parent @@ -145,29 +169,29 @@ function cleanupEnv() { "); - sb.AppendLine($"Describe '{variantGroup.CmdletName}' {{"); - var variants = variantGroup.Variants - .Where(v => IncludeGenerated || !v.Attributes.OfType().Any()) - .ToList(); + sb.AppendLine($"Describe '{variantGroup.CmdletName}' {{"); + var variants = variantGroup.Variants + .Where(v => IncludeGenerated || !v.Attributes.OfType().Any()) + .ToList(); + + foreach (var variant in variants) + { + sb.AppendLine($"{Indent}It '{variant.VariantName}' -skip {{"); + sb.AppendLine($"{Indent}{Indent}{{ throw [System.NotImplementedException] }} | Should -Not -Throw"); + var variantSeparator = variants.IndexOf(variant) == variants.Count - 1 ? String.Empty : Environment.NewLine; + sb.AppendLine($"{Indent}}}{variantSeparator}"); + } + sb.AppendLine("}"); - foreach (var variant in variants) + File.WriteAllText(variantGroup.FilePath, sb.ToString()); + } + } + } + catch (Exception ee) { - sb.AppendLine($"{Indent}It '{variant.VariantName}' -skip {{"); - sb.AppendLine($"{Indent}{Indent}{{ throw [System.NotImplementedException] }} | Should -Not -Throw"); - var variantSeparator = variants.IndexOf(variant) == variants.Count - 1 ? String.Empty : Environment.NewLine; - sb.AppendLine($"{Indent}}}{variantSeparator}"); + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; } - sb.AppendLine("}"); - - File.WriteAllText(variantGroup.FilePath, sb.ToString()); - } } - } - catch (Exception ee) - { - Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); - throw ee; - } } - } } diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index 91d9b00aa536..7d688f462518 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -290,9 +290,27 @@ private string GetDefaultValuesStatements() { setCondition = $" -and {defaultInfo.SetCondition}"; } - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); - sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); - sb.Append($"{Indent}{Indent}}}"); + //Yabo: this is bad to hard code the subscription id, but autorest load input README.md reversely (entry readme -> required readme), there are no other way to + //override default value set in required readme + if ("SubscriptionId".Equals(parameterName)) + { + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); + sb.AppendLine($"{Indent}{Indent}{Indent}$testPlayback = $false"); + sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }}"); + sb.AppendLine($"{Indent}{Indent}{Indent}if ($testPlayback) {{"); + sb.AppendLine($"{Indent}{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')"); + sb.AppendLine($"{Indent}{Indent}{Indent}}} else {{"); + sb.AppendLine($"{Indent}{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); + sb.AppendLine($"{Indent}{Indent}{Indent}}}"); + sb.Append($"{Indent}{Indent}}}"); + } + else + { + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); + sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); + sb.Append($"{Indent}{Indent}}}"); + } + } return sb.ToString(); } diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/internal/Az.ConnectedMachine.internal.psm1 b/src/ConnectedMachine/ConnectedMachine.Autorest/internal/Az.ConnectedMachine.internal.psm1 index 68bf1cf91523..b2424141103a 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/internal/Az.ConnectedMachine.internal.psm1 +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/internal/Az.ConnectedMachine.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/ConnectedMachine/ConnectedMachine.Autorest/test-module.ps1 b/src/ConnectedMachine/ConnectedMachine.Autorest/test-module.ps1 index 094f3c6ffac1..9d615e285d08 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/test-module.ps1 +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/test-module.ps1 @@ -74,13 +74,14 @@ try if ($TestMode -ne 'playback') { setupEnv + } else { + $env:AzPSAutorestTestPlaybackMode = $true } $testFolder = Join-Path $PSScriptRoot 'test' if ($null -ne $TestName) { Invoke-Pester -Script @{ Path = $testFolder } -TestName $TestName -ExcludeTag $ExcludeTag -EnableExit -OutputFile (Join-Path $testFolder "$moduleName-TestResults.xml") - } else - { + } else { Invoke-Pester -Script @{ Path = $testFolder } -ExcludeTag $ExcludeTag -EnableExit -OutputFile (Join-Path $testFolder "$moduleName-TestResults.xml") } } Finally @@ -89,6 +90,9 @@ try { cleanupEnv } + else { + $env:AzPSAutorestTestPlaybackMode = '' + } } Write-Host -ForegroundColor Green '-------------Done-------------' diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/test/Remove-AzConnectedMachine.Tests.ps1 b/src/ConnectedMachine/ConnectedMachine.Autorest/test/Remove-AzConnectedMachine.Tests.ps1 index 4f3987f0bbd7..2c426a4afe44 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/test/Remove-AzConnectedMachine.Tests.ps1 +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/test/Remove-AzConnectedMachine.Tests.ps1 @@ -76,13 +76,8 @@ Describe 'Remove-AzConnectedMachine' { # Tests include -SubscriptionId automatically but it causes # piping to fail. This temporarily removes that default value for # this test. - $PSDefaultParameterValues["Remove-AzConnectedMachine:SubscriptionId"] = @{} - try { - { Get-AzConnectedMachine -Name $machineName -ResourceGroupName $env.ResourceGroupName } | Should -Not -Throw - Get-AzConnectedMachine -Name $machineName -ResourceGroupName $env.ResourceGroupName | Remove-AzConnectedMachine - { Get-AzConnectedMachine -Name $machineName -ResourceGroupName $env.ResourceGroupName } | Should -Throw - } finally { - $PSDefaultParameterValues.Remove("Remove-AzConnectedMachine:SubscriptionId") - } + { Get-AzConnectedMachine -Name $machineName -ResourceGroupName $env.ResourceGroupName } | Should -Not -Throw + Get-AzConnectedMachine -Name $machineName -ResourceGroupName $env.ResourceGroupName | Remove-AzConnectedMachine + { Get-AzConnectedMachine -Name $machineName -ResourceGroupName $env.ResourceGroupName } | Should -Throw } -} +} \ No newline at end of file diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/test/Update-AzConnectedMachineExtension.Tests.ps1 b/src/ConnectedMachine/ConnectedMachine.Autorest/test/Update-AzConnectedMachineExtension.Tests.ps1 index 0a56c1e3aa99..ce69e79131a1 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/test/Update-AzConnectedMachineExtension.Tests.ps1 +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/test/Update-AzConnectedMachineExtension.Tests.ps1 @@ -87,16 +87,10 @@ Describe 'Update-AzConnectedMachineExtension' { # Tests include -SubscriptionId automatically but it causes # piping to fail. This temporarily removes that default value for # this test. - $before = $PSDefaultParameterValues["*:SubscriptionId"] - $PSDefaultParameterValues.Remove("*:SubscriptionId") - try { - $result = $currentExtension | Update-AzConnectedMachineExtension -Settings @{ - commandToExecute = $newCommand - } - $result.Setting["commandToExecute"] | Should -Be $newCommand - } finally { - $PSDefaultParameterValues["*:SubscriptionId"] = $before + $result = $currentExtension | Update-AzConnectedMachineExtension -Settings @{ + commandToExecute = $newCommand } + $result.Setting["commandToExecute"] | Should -Be $newCommand } It 'UpdateViaIdentity parameter set' { @@ -107,13 +101,7 @@ Describe 'Update-AzConnectedMachineExtension' { # Tests include -SubscriptionId automatically but it causes # piping to fail. This temporarily removes that default value for # this test. - $before = $PSDefaultParameterValues["*:SubscriptionId"] - $PSDefaultParameterValues.Remove("*:SubscriptionId") - try { - $result = $currentExtension | Update-AzConnectedMachineExtension -ExtensionParameter $currentExtension - $result.Setting["commandToExecute"] | Should -Be $newCommand - } finally { - $PSDefaultParameterValues["*:SubscriptionId"] = $before - } - } -} + $result = $currentExtension | Update-AzConnectedMachineExtension -ExtensionParameter $currentExtension + $result.Setting["commandToExecute"] | Should -Be $newCommand + } +} \ No newline at end of file diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/test/loadEnv.ps1 b/src/ConnectedMachine/ConnectedMachine.Autorest/test/loadEnv.ps1 index 5f079e89615e..6a7c385c6b7d 100644 --- a/src/ConnectedMachine/ConnectedMachine.Autorest/test/loadEnv.ps1 +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/test/loadEnv.ps1 @@ -25,5 +25,5 @@ if (Test-Path -Path (Join-Path $PSScriptRoot $envFile)) { $env = @{} if (Test-Path -Path $envFilePath) { $env = Get-Content (Join-Path $PSScriptRoot $envFile) | ConvertFrom-Json - $PSDefaultParameterValues=@{"*:SubscriptionId"=$env.SubscriptionId; "*:Tenant"=$env.Tenant} + $PSDefaultParameterValues=@{"*:Tenant"=$env.Tenant} } \ No newline at end of file diff --git a/src/ConnectedMachine/ConnectedMachine.Autorest/utils/Get-SubscriptionIdTestSafe.ps1 b/src/ConnectedMachine/ConnectedMachine.Autorest/utils/Get-SubscriptionIdTestSafe.ps1 new file mode 100644 index 000000000000..5319862d3372 --- /dev/null +++ b/src/ConnectedMachine/ConnectedMachine.Autorest/utils/Get-SubscriptionIdTestSafe.ps1 @@ -0,0 +1,7 @@ +param() +if ($env:AzPSAutorestTestPlaybackMode) { + $loadEnvPath = Join-Path $PSScriptRoot '..' 'test' 'loadEnv.ps1' + . ($loadEnvPath) + return $env.SubscriptionId +} +return (Get-AzContext).Subscription.Id \ No newline at end of file diff --git a/src/ConnectedMachine/ConnectedMachine/Az.ConnectedMachine.psd1 b/src/ConnectedMachine/ConnectedMachine/Az.ConnectedMachine.psd1 index ca3015af317a..7799c76350dd 100644 --- a/src/ConnectedMachine/ConnectedMachine/Az.ConnectedMachine.psd1 +++ b/src/ConnectedMachine/ConnectedMachine/Az.ConnectedMachine.psd1 @@ -3,7 +3,7 @@ # # Generated by: Microsoft Corporation # -# Generated on: 3/17/2024 +# Generated on: 3/25/2024 # @{