Skip to content

Commit 248d74d

Browse files
Move App to main
1 parent 5100627 commit 248d74d

File tree

545 files changed

+13411
-6131
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

545 files changed

+13411
-6131
lines changed

src/App/App.Autorest/Az.App.psm1

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,37 +47,41 @@
4747

4848
# Ask for the shared functionality table
4949
$VTable = Register-AzModule
50-
50+
5151
# Tweaks the pipeline on module load
5252
$instance.OnModuleLoad = $VTable.OnModuleLoad
5353

5454
# Following two delegates are added for telemetry
5555
$instance.GetTelemetryId = $VTable.GetTelemetryId
5656
$instance.Telemetry = $VTable.Telemetry
57-
57+
58+
# Delegate to sanitize the output object
59+
$instance.SanitizeOutput = $VTable.SanitizerHandler
60+
61+
# Delegate to get the telemetry info
62+
$instance.GetTelemetryInfo = $VTable.GetTelemetryInfo
5863

5964
# Tweaks the pipeline per call
6065
$instance.OnNewRequest = $VTable.OnNewRequest
61-
66+
6267
# Gets shared parameter values
6368
$instance.GetParameterValue = $VTable.GetParameterValue
64-
69+
6570
# Allows shared module to listen to events from this module
6671
$instance.EventListener = $VTable.EventListener
67-
72+
6873
# Gets shared argument completers
6974
$instance.ArgumentCompleter = $VTable.ArgumentCompleter
70-
75+
7176
# The name of the currently selected Azure profile
7277
$instance.ProfileName = $VTable.ProfileName
7378

74-
7579
# Load the custom module
7680
$customModulePath = Join-Path $PSScriptRoot './custom/Az.App.custom.psm1'
7781
if(Test-Path $customModulePath) {
7882
$null = Import-Module -Name $customModulePath
7983
}
80-
84+
8185
# Export nothing to clear implicit exports
8286
Export-ModuleMember
8387

@@ -97,12 +101,12 @@
97101
# Load the last folder if no profile is selected
98102
$profileDirectory = $directories | Select-Object -Last 1
99103
}
100-
104+
101105
if($profileDirectory) {
102106
Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'"
103107
$exportsPath = $profileDirectory.FullName
104108
}
105-
109+
106110
if($exportsPath) {
107111
Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
108112
$cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath

src/App/App.Autorest/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
This directory contains the PowerShell module for the App service.
44

55
---
6-
76
## Info
87
- Modifiable: yes
98
- Generated: all

src/App/App.Autorest/exports/Disable-AzContainerAppRevision.ps1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,12 @@ param(
112112
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Path')]
113113
[Microsoft.Azure.PowerShell.Cmdlets.App.Models.IAppIdentity]
114114
# Identity Parameter
115-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
116115
${InputObject},
117116

118117
[Parameter(ParameterSetName='DeactivateViaIdentityContainerApp', Mandatory, ValueFromPipeline)]
119118
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Path')]
120119
[Microsoft.Azure.PowerShell.Cmdlets.App.Models.IAppIdentity]
121120
# Identity Parameter
122-
# To construct, see NOTES section for CONTAINERAPPINPUTOBJECT properties and create a hash table.
123121
${ContainerAppInputObject},
124122

125123
[Parameter()]
@@ -208,7 +206,13 @@ begin {
208206
DeactivateViaIdentityContainerApp = 'Az.App.private\Disable-AzContainerAppRevision_DeactivateViaIdentityContainerApp';
209207
}
210208
if (('Deactivate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
211-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
209+
$testPlayback = $false
210+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
211+
if ($testPlayback) {
212+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
213+
} else {
214+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
215+
}
212216
}
213217
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
214218
[Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/App/App.Autorest/exports/Enable-AzContainerAppRevision.ps1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,12 @@ param(
112112
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Path')]
113113
[Microsoft.Azure.PowerShell.Cmdlets.App.Models.IAppIdentity]
114114
# Identity Parameter
115-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
116115
${InputObject},
117116

118117
[Parameter(ParameterSetName='ActivateViaIdentityContainerApp', Mandatory, ValueFromPipeline)]
119118
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Path')]
120119
[Microsoft.Azure.PowerShell.Cmdlets.App.Models.IAppIdentity]
121120
# Identity Parameter
122-
# To construct, see NOTES section for CONTAINERAPPINPUTOBJECT properties and create a hash table.
123121
${ContainerAppInputObject},
124122

125123
[Parameter()]
@@ -208,7 +206,13 @@ begin {
208206
ActivateViaIdentityContainerApp = 'Az.App.private\Enable-AzContainerAppRevision_ActivateViaIdentityContainerApp';
209207
}
210208
if (('Activate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
211-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
209+
$testPlayback = $false
210+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
211+
if ($testPlayback) {
212+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
213+
} else {
214+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
215+
}
212216
}
213217
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
214218
[Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/App/App.Autorest/exports/Get-AzContainerApp.ps1

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ param(
8989
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Path')]
9090
[Microsoft.Azure.PowerShell.Cmdlets.App.Models.IAppIdentity]
9191
# Identity Parameter
92-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
9392
${InputObject},
9493

9594
[Parameter()]
@@ -121,13 +120,6 @@ param(
121120
# SendAsync Pipeline Steps to be prepended to the front of the pipeline
122121
${HttpPipelinePrepend},
123122

124-
[Parameter(ParameterSetName='Get')]
125-
[Parameter(ParameterSetName='GetViaIdentity')]
126-
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Runtime')]
127-
[System.Management.Automation.SwitchParameter]
128-
# Returns true when the command succeeds
129-
${PassThru},
130-
131123
[Parameter(DontShow)]
132124
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Runtime')]
133125
[System.Uri]
@@ -180,7 +172,13 @@ begin {
180172
List1 = 'Az.App.private\Get-AzContainerApp_List1';
181173
}
182174
if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
183-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
175+
$testPlayback = $false
176+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
177+
if ($testPlayback) {
178+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
179+
} else {
180+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
181+
}
184182
}
185183
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
186184
[Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/App/App.Autorest/exports/Get-AzContainerAppAuthConfig.ps1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,12 @@ param(
117117
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Path')]
118118
[Microsoft.Azure.PowerShell.Cmdlets.App.Models.IAppIdentity]
119119
# Identity Parameter
120-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
121120
${InputObject},
122121

123122
[Parameter(ParameterSetName='GetViaIdentityContainerApp', Mandatory, ValueFromPipeline)]
124123
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Path')]
125124
[Microsoft.Azure.PowerShell.Cmdlets.App.Models.IAppIdentity]
126125
# Identity Parameter
127-
# To construct, see NOTES section for CONTAINERAPPINPUTOBJECT properties and create a hash table.
128126
${ContainerAppInputObject},
129127

130128
[Parameter()]
@@ -208,7 +206,13 @@ begin {
208206
List = 'Az.App.private\Get-AzContainerAppAuthConfig_List';
209207
}
210208
if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
211-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
209+
$testPlayback = $false
210+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
211+
if ($testPlayback) {
212+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
213+
} else {
214+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
215+
}
212216
}
213217
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
214218
[Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/App/App.Autorest/exports/Get-AzContainerAppAuthToken.ps1

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ param(
8484
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Path')]
8585
[Microsoft.Azure.PowerShell.Cmdlets.App.Models.IAppIdentity]
8686
# Identity Parameter
87-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
8887
${InputObject},
8988

9089
[Parameter()]
@@ -116,12 +115,6 @@ param(
116115
# SendAsync Pipeline Steps to be prepended to the front of the pipeline
117116
${HttpPipelinePrepend},
118117

119-
[Parameter()]
120-
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Runtime')]
121-
[System.Management.Automation.SwitchParameter]
122-
# Returns true when the command succeeds
123-
${PassThru},
124-
125118
[Parameter(DontShow)]
126119
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Runtime')]
127120
[System.Uri]
@@ -172,7 +165,13 @@ begin {
172165
GetViaIdentity = 'Az.App.private\Get-AzContainerAppAuthToken_GetViaIdentity';
173166
}
174167
if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
175-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
168+
$testPlayback = $false
169+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
170+
if ($testPlayback) {
171+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
172+
} else {
173+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
174+
}
176175
}
177176
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
178177
[Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/App/App.Autorest/exports/Get-AzContainerAppAvailableWorkloadProfile.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ param(
7474
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Path')]
7575
[Microsoft.Azure.PowerShell.Cmdlets.App.Models.IAppIdentity]
7676
# Identity Parameter
77-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
7877
${InputObject},
7978

8079
[Parameter()]
@@ -156,7 +155,13 @@ begin {
156155
GetViaIdentity = 'Az.App.private\Get-AzContainerAppAvailableWorkloadProfile_GetViaIdentity';
157156
}
158157
if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
159-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
158+
$testPlayback = $false
159+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
160+
if ($testPlayback) {
161+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
162+
} else {
163+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
164+
}
160165
}
161166
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
162167
[Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/App/App.Autorest/exports/Get-AzContainerAppBillingMeter.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ param(
7474
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Path')]
7575
[Microsoft.Azure.PowerShell.Cmdlets.App.Models.IAppIdentity]
7676
# Identity Parameter
77-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
7877
${InputObject},
7978

8079
[Parameter()]
@@ -156,7 +155,13 @@ begin {
156155
GetViaIdentity = 'Az.App.private\Get-AzContainerAppBillingMeter_GetViaIdentity';
157156
}
158157
if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
159-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
158+
$testPlayback = $false
159+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
160+
if ($testPlayback) {
161+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
162+
} else {
163+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
164+
}
160165
}
161166
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
162167
[Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/App/App.Autorest/exports/Get-AzContainerAppConnectedEnv.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ param(
8989
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Path')]
9090
[Microsoft.Azure.PowerShell.Cmdlets.App.Models.IAppIdentity]
9191
# Identity Parameter
92-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
9392
${InputObject},
9493

9594
[Parameter()]
@@ -173,7 +172,13 @@ begin {
173172
List1 = 'Az.App.private\Get-AzContainerAppConnectedEnv_List1';
174173
}
175174
if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
176-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
175+
$testPlayback = $false
176+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
177+
if ($testPlayback) {
178+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
179+
} else {
180+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
181+
}
177182
}
178183
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
179184
[Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/App/App.Autorest/exports/Get-AzContainerAppConnectedEnvCert.ps1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,12 @@ param(
117117
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Path')]
118118
[Microsoft.Azure.PowerShell.Cmdlets.App.Models.IAppIdentity]
119119
# Identity Parameter
120-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
121120
${InputObject},
122121

123122
[Parameter(ParameterSetName='GetViaIdentityConnectedEnvironment', Mandatory, ValueFromPipeline)]
124123
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Path')]
125124
[Microsoft.Azure.PowerShell.Cmdlets.App.Models.IAppIdentity]
126125
# Identity Parameter
127-
# To construct, see NOTES section for CONNECTEDENVIRONMENTINPUTOBJECT properties and create a hash table.
128126
${ConnectedEnvironmentInputObject},
129127

130128
[Parameter()]
@@ -208,7 +206,13 @@ begin {
208206
List = 'Az.App.private\Get-AzContainerAppConnectedEnvCert_List';
209207
}
210208
if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
211-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
209+
$testPlayback = $false
210+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
211+
if ($testPlayback) {
212+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
213+
} else {
214+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
215+
}
212216
}
213217
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
214218
[Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/App/App.Autorest/exports/Get-AzContainerAppConnectedEnvDapr.ps1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,12 @@ param(
117117
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Path')]
118118
[Microsoft.Azure.PowerShell.Cmdlets.App.Models.IAppIdentity]
119119
# Identity Parameter
120-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
121120
${InputObject},
122121

123122
[Parameter(ParameterSetName='GetViaIdentityConnectedEnvironment', Mandatory, ValueFromPipeline)]
124123
[Microsoft.Azure.PowerShell.Cmdlets.App.Category('Path')]
125124
[Microsoft.Azure.PowerShell.Cmdlets.App.Models.IAppIdentity]
126125
# Identity Parameter
127-
# To construct, see NOTES section for CONNECTEDENVIRONMENTINPUTOBJECT properties and create a hash table.
128126
${ConnectedEnvironmentInputObject},
129127

130128
[Parameter()]
@@ -208,7 +206,13 @@ begin {
208206
List = 'Az.App.private\Get-AzContainerAppConnectedEnvDapr_List';
209207
}
210208
if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
211-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
209+
$testPlayback = $false
210+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
211+
if ($testPlayback) {
212+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
213+
} else {
214+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
215+
}
212216
}
213217
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
214218
[Microsoft.Azure.PowerShell.Cmdlets.App.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

0 commit comments

Comments
 (0)