Skip to content

Commit 02107b0

Browse files
Migrate PaloAltoNetworks from generation to main (#24502)
* Move PaloAltoNetworks to main * Update ChangeLog.md --------- Co-authored-by: Vincent Dai <[email protected]>
1 parent b316bfb commit 02107b0

File tree

182 files changed

+3157
-987
lines changed

Some content is hidden

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

182 files changed

+3157
-987
lines changed

src/PaloAltoNetworks/PaloAltoNetworks.Autorest/Az.PaloAltoNetworks.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.PaloAltoNetworks.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/PaloAltoNetworks/PaloAltoNetworks.Autorest/README.md

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

55
---
6-
76
## Info
87
- Modifiable: yes
98
- Generated: all
@@ -37,9 +36,11 @@ input-file:
3736
title: PaloAltoNetworks
3837
module-version: 0.2.0
3938
subject-prefix: $(service-name)
39+
disable-transform-identity-type: true
40+
flatten-userassignedidentity: false
4041

4142
directive:
42-
- from: swagger-document
43+
- from: swagger-document
4344
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/commit"].post.responses
4445
transform: >-
4546
return {
@@ -57,7 +58,7 @@ directive:
5758
}
5859
}
5960
60-
- from: swagger-document
61+
- from: swagger-document
6162
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/revert"].post.responses
6263
transform: >-
6364
return {

src/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksCertificateObjectLocalRulestack.ps1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,12 @@ param(
9393
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Category('Path')]
9494
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Models.IPaloAltoNetworksIdentity]
9595
# Identity Parameter
96-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
9796
${InputObject},
9897

9998
[Parameter(ParameterSetName='GetViaIdentityLocalRulestack', Mandatory, ValueFromPipeline)]
10099
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Category('Path')]
101100
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Models.IPaloAltoNetworksIdentity]
102101
# Identity Parameter
103-
# To construct, see NOTES section for LOCALRULESTACKINPUTOBJECT properties and create a hash table.
104102
${LocalRulestackInputObject},
105103

106104
[Parameter()]
@@ -184,7 +182,13 @@ begin {
184182
List = 'Az.PaloAltoNetworks.private\Get-AzPaloAltoNetworksCertificateObjectLocalRulestack_List';
185183
}
186184
if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
187-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
185+
$testPlayback = $false
186+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
187+
if ($testPlayback) {
188+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
189+
} else {
190+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
191+
}
188192
}
189193
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
190194
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksFirewall.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ param(
7979
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Category('Path')]
8080
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Models.IPaloAltoNetworksIdentity]
8181
# Identity Parameter
82-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
8382
${InputObject},
8483

8584
[Parameter()]
@@ -163,7 +162,13 @@ begin {
163162
List1 = 'Az.PaloAltoNetworks.private\Get-AzPaloAltoNetworksFirewall_List1';
164163
}
165164
if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
166-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
165+
$testPlayback = $false
166+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
167+
if ($testPlayback) {
168+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
169+
} else {
170+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
171+
}
167172
}
168173
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
169174
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksFirewallLogProfile.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ param(
7171
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Category('Path')]
7272
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Models.IPaloAltoNetworksIdentity]
7373
# Identity Parameter
74-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
7574
${InputObject},
7675

7776
[Parameter()]
@@ -153,7 +152,13 @@ begin {
153152
GetViaIdentity = 'Az.PaloAltoNetworks.private\Get-AzPaloAltoNetworksFirewallLogProfile_GetViaIdentity';
154153
}
155154
if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
156-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
155+
$testPlayback = $false
156+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
157+
if ($testPlayback) {
158+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
159+
} else {
160+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
161+
}
157162
}
158163
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
159164
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksFirewallStatus.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.PaloAltoNetworks.Category('Path')]
7575
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Models.IPaloAltoNetworksIdentity]
7676
# Identity Parameter
77-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
7877
${InputObject},
7978

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

src/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksFqdnListLocalRulestack.ps1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,12 @@ param(
9393
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Category('Path')]
9494
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Models.IPaloAltoNetworksIdentity]
9595
# Identity Parameter
96-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
9796
${InputObject},
9897

9998
[Parameter(ParameterSetName='GetViaIdentityLocalRulestack', Mandatory, ValueFromPipeline)]
10099
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Category('Path')]
101100
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Models.IPaloAltoNetworksIdentity]
102101
# Identity Parameter
103-
# To construct, see NOTES section for LOCALRULESTACKINPUTOBJECT properties and create a hash table.
104102
${LocalRulestackInputObject},
105103

106104
[Parameter()]
@@ -184,7 +182,13 @@ begin {
184182
List = 'Az.PaloAltoNetworks.private\Get-AzPaloAltoNetworksFqdnListLocalRulestack_List';
185183
}
186184
if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
187-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
185+
$testPlayback = $false
186+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
187+
if ($testPlayback) {
188+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
189+
} else {
190+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
191+
}
188192
}
189193
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
190194
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksLocalRule.ps1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,12 @@ param(
9393
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Category('Path')]
9494
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Models.IPaloAltoNetworksIdentity]
9595
# Identity Parameter
96-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
9796
${InputObject},
9897

9998
[Parameter(ParameterSetName='GetViaIdentityLocalRulestack', Mandatory, ValueFromPipeline)]
10099
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Category('Path')]
101100
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Models.IPaloAltoNetworksIdentity]
102101
# Identity Parameter
103-
# To construct, see NOTES section for LOCALRULESTACKINPUTOBJECT properties and create a hash table.
104102
${LocalRulestackInputObject},
105103

106104
[Parameter()]
@@ -184,7 +182,13 @@ begin {
184182
List = 'Az.PaloAltoNetworks.private\Get-AzPaloAltoNetworksLocalRule_List';
185183
}
186184
if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
187-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
185+
$testPlayback = $false
186+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
187+
if ($testPlayback) {
188+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
189+
} else {
190+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
191+
}
188192
}
189193
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
190194
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksLocalRulestack.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ param(
7979
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Category('Path')]
8080
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Models.IPaloAltoNetworksIdentity]
8181
# Identity Parameter
82-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
8382
${InputObject},
8483

8584
[Parameter()]
@@ -163,7 +162,13 @@ begin {
163162
List1 = 'Az.PaloAltoNetworks.private\Get-AzPaloAltoNetworksLocalRulestack_List1';
164163
}
165164
if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
166-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
165+
$testPlayback = $false
166+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
167+
if ($testPlayback) {
168+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
169+
} else {
170+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
171+
}
167172
}
168173
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
169174
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksLocalRulestackAppId.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,13 @@ begin {
153153
List = 'Az.PaloAltoNetworks.private\Get-AzPaloAltoNetworksLocalRulestackAppId_List';
154154
}
155155
if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
156-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
156+
$testPlayback = $false
157+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
158+
if ($testPlayback) {
159+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
160+
} else {
161+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
162+
}
157163
}
158164
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
159165
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksLocalRulestackChangeLog.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ param(
7171
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Category('Path')]
7272
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Models.IPaloAltoNetworksIdentity]
7373
# Identity Parameter
74-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
7574
${InputObject},
7675

7776
[Parameter()]
@@ -153,7 +152,13 @@ begin {
153152
GetViaIdentity = 'Az.PaloAltoNetworks.private\Get-AzPaloAltoNetworksLocalRulestackChangeLog_GetViaIdentity';
154153
}
155154
if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
156-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
155+
$testPlayback = $false
156+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
157+
if ($testPlayback) {
158+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
159+
} else {
160+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
161+
}
157162
}
158163
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
159164
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksLocalRulestackFirewall.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,13 @@ begin {
129129
List = 'Az.PaloAltoNetworks.private\Get-AzPaloAltoNetworksLocalRulestackFirewall_List';
130130
}
131131
if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
132-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
132+
$testPlayback = $false
133+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
134+
if ($testPlayback) {
135+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
136+
} else {
137+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
138+
}
133139
}
134140
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
135141
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksLocalRulestackSupportInfo.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ param(
7171
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Category('Path')]
7272
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Models.IPaloAltoNetworksIdentity]
7373
# Identity Parameter
74-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
7574
${InputObject},
7675

7776
[Parameter()]
@@ -159,7 +158,13 @@ begin {
159158
GetViaIdentity = 'Az.PaloAltoNetworks.private\Get-AzPaloAltoNetworksLocalRulestackSupportInfo_GetViaIdentity';
160159
}
161160
if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
162-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
161+
$testPlayback = $false
162+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
163+
if ($testPlayback) {
164+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
165+
} else {
166+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
167+
}
163168
}
164169
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
165170
[Microsoft.Azure.PowerShell.Cmdlets.PaloAltoNetworks.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

0 commit comments

Comments
 (0)