Skip to content

Commit b0f8cab

Browse files
Migrate Security from generation to main (#24495)
* Move Security to main * Update ChangeLog.md --------- Co-authored-by: Vincent Dai <23257217+vidai-msft@users.noreply.github.com>
1 parent cc5b2cd commit b0f8cab

File tree

263 files changed

+6152
-1781
lines changed

Some content is hidden

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

263 files changed

+6152
-1781
lines changed

src/Security/Security.Autorest/Az.Security.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.Security.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/Security/Security.Autorest/exports/Get-AzSecurityApiCollection.ps1

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ param(
9595
[Microsoft.Azure.PowerShell.Cmdlets.Security.Category('Path')]
9696
[Microsoft.Azure.PowerShell.Cmdlets.Security.Models.ISecurityIdentity]
9797
# Identity Parameter
98-
# .
9998
${InputObject},
10099

101100
[Parameter()]
@@ -110,7 +109,7 @@ param(
110109
[Parameter(DontShow)]
111110
[Microsoft.Azure.PowerShell.Cmdlets.Security.Category('Runtime')]
112111
[System.Management.Automation.SwitchParameter]
113-
# Wait forNET debugger to attach
112+
# Wait for .NET debugger to attach
114113
${Break},
115114

116115
[Parameter(DontShow)]
@@ -180,7 +179,13 @@ begin {
180179
List2 = 'Az.Security.private\Get-AzSecurityApiCollection_List2';
181180
}
182181
if (('Get', 'List', 'List1', 'List2') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
183-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
182+
$testPlayback = $false
183+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Security.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
184+
if ($testPlayback) {
185+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
186+
} else {
187+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
188+
}
184189
}
185190
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
186191
[Microsoft.Azure.PowerShell.Cmdlets.Security.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/Security/Security.Autorest/exports/Get-AzSecurityConnector.ps1

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ param(
8181
[Microsoft.Azure.PowerShell.Cmdlets.Security.Category('Path')]
8282
[Microsoft.Azure.PowerShell.Cmdlets.Security.Models.ISecurityIdentity]
8383
# Identity Parameter
84-
# .
8584
${InputObject},
8685

8786
[Parameter()]
@@ -96,7 +95,7 @@ param(
9695
[Parameter(DontShow)]
9796
[Microsoft.Azure.PowerShell.Cmdlets.Security.Category('Runtime')]
9897
[System.Management.Automation.SwitchParameter]
99-
# Wait forNET debugger to attach
98+
# Wait for .NET debugger to attach
10099
${Break},
101100

102101
[Parameter(DontShow)]
@@ -165,7 +164,13 @@ begin {
165164
List1 = 'Az.Security.private\Get-AzSecurityConnector_List1';
166165
}
167166
if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
168-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
167+
$testPlayback = $false
168+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Security.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
169+
if ($testPlayback) {
170+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
171+
} else {
172+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
173+
}
169174
}
170175
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
171176
[Microsoft.Azure.PowerShell.Cmdlets.Security.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/Security/Security.Autorest/exports/Get-AzSecurityConnectorAzureDevOpsOrg.ps1

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ param(
8686
[Microsoft.Azure.PowerShell.Cmdlets.Security.Category('Path')]
8787
[Microsoft.Azure.PowerShell.Cmdlets.Security.Models.ISecurityIdentity]
8888
# Identity Parameter
89-
# .
9089
${InputObject},
9190

9291
[Parameter()]
@@ -101,7 +100,7 @@ param(
101100
[Parameter(DontShow)]
102101
[Microsoft.Azure.PowerShell.Cmdlets.Security.Category('Runtime')]
103102
[System.Management.Automation.SwitchParameter]
104-
# Wait forNET debugger to attach
103+
# Wait for .NET debugger to attach
105104
${Break},
106105

107106
[Parameter(DontShow)]
@@ -169,7 +168,13 @@ begin {
169168
List = 'Az.Security.private\Get-AzSecurityConnectorAzureDevOpsOrg_List';
170169
}
171170
if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
172-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
171+
$testPlayback = $false
172+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Security.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
173+
if ($testPlayback) {
174+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
175+
} else {
176+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
177+
}
173178
}
174179
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
175180
[Microsoft.Azure.PowerShell.Cmdlets.Security.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/Security/Security.Autorest/exports/Get-AzSecurityConnectorAzureDevOpsOrgAvailable.ps1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ param(
6363
[Parameter(DontShow)]
6464
[Microsoft.Azure.PowerShell.Cmdlets.Security.Category('Runtime')]
6565
[System.Management.Automation.SwitchParameter]
66-
# Wait forNET debugger to attach
66+
# Wait for .NET debugger to attach
6767
${Break},
6868

6969
[Parameter(DontShow)]
@@ -129,7 +129,13 @@ begin {
129129
List = 'Az.Security.private\Get-AzSecurityConnectorAzureDevOpsOrgAvailable_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.Security.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.Security.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/Security/Security.Autorest/exports/Get-AzSecurityConnectorAzureDevOpsProject.ps1

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ param(
9393
[Microsoft.Azure.PowerShell.Cmdlets.Security.Category('Path')]
9494
[Microsoft.Azure.PowerShell.Cmdlets.Security.Models.ISecurityIdentity]
9595
# Identity Parameter
96-
# .
9796
${InputObject},
9897

9998
[Parameter()]
@@ -108,7 +107,7 @@ param(
108107
[Parameter(DontShow)]
109108
[Microsoft.Azure.PowerShell.Cmdlets.Security.Category('Runtime')]
110109
[System.Management.Automation.SwitchParameter]
111-
# Wait forNET debugger to attach
110+
# Wait for .NET debugger to attach
112111
${Break},
113112

114113
[Parameter(DontShow)]
@@ -176,7 +175,13 @@ begin {
176175
List = 'Az.Security.private\Get-AzSecurityConnectorAzureDevOpsProject_List';
177176
}
178177
if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
179-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
178+
$testPlayback = $false
179+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Security.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
180+
if ($testPlayback) {
181+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
182+
} else {
183+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
184+
}
180185
}
181186
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
182187
[Microsoft.Azure.PowerShell.Cmdlets.Security.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/Security/Security.Autorest/exports/Get-AzSecurityConnectorAzureDevOpsRepo.ps1

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ param(
100100
[Microsoft.Azure.PowerShell.Cmdlets.Security.Category('Path')]
101101
[Microsoft.Azure.PowerShell.Cmdlets.Security.Models.ISecurityIdentity]
102102
# Identity Parameter
103-
# .
104103
${InputObject},
105104

106105
[Parameter()]
@@ -115,7 +114,7 @@ param(
115114
[Parameter(DontShow)]
116115
[Microsoft.Azure.PowerShell.Cmdlets.Security.Category('Runtime')]
117116
[System.Management.Automation.SwitchParameter]
118-
# Wait forNET debugger to attach
117+
# Wait for .NET debugger to attach
119118
${Break},
120119

121120
[Parameter(DontShow)]
@@ -183,7 +182,13 @@ begin {
183182
List = 'Az.Security.private\Get-AzSecurityConnectorAzureDevOpsRepo_List';
184183
}
185184
if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
186-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
185+
$testPlayback = $false
186+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Security.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+
}
187192
}
188193
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
189194
[Microsoft.Azure.PowerShell.Cmdlets.Security.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/Security/Security.Autorest/exports/Get-AzSecurityConnectorDevOpsConfiguration.ps1

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ param(
8080
[Microsoft.Azure.PowerShell.Cmdlets.Security.Category('Path')]
8181
[Microsoft.Azure.PowerShell.Cmdlets.Security.Models.ISecurityIdentity]
8282
# Identity Parameter
83-
# .
8483
${InputObject},
8584

8685
[Parameter()]
@@ -95,7 +94,7 @@ param(
9594
[Parameter(DontShow)]
9695
[Microsoft.Azure.PowerShell.Cmdlets.Security.Category('Runtime')]
9796
[System.Management.Automation.SwitchParameter]
98-
# Wait forNET debugger to attach
97+
# Wait for .NET debugger to attach
9998
${Break},
10099

101100
[Parameter(DontShow)]
@@ -163,7 +162,13 @@ begin {
163162
List = 'Az.Security.private\Get-AzSecurityConnectorDevOpsConfiguration_List';
164163
}
165164
if (('Get', 'List') -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.Security.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.Security.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/Security/Security.Autorest/exports/Get-AzSecurityConnectorGitHubOwner.ps1

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ param(
8686
[Microsoft.Azure.PowerShell.Cmdlets.Security.Category('Path')]
8787
[Microsoft.Azure.PowerShell.Cmdlets.Security.Models.ISecurityIdentity]
8888
# Identity Parameter
89-
# .
9089
${InputObject},
9190

9291
[Parameter()]
@@ -101,7 +100,7 @@ param(
101100
[Parameter(DontShow)]
102101
[Microsoft.Azure.PowerShell.Cmdlets.Security.Category('Runtime')]
103102
[System.Management.Automation.SwitchParameter]
104-
# Wait forNET debugger to attach
103+
# Wait for .NET debugger to attach
105104
${Break},
106105

107106
[Parameter(DontShow)]
@@ -169,7 +168,13 @@ begin {
169168
List = 'Az.Security.private\Get-AzSecurityConnectorGitHubOwner_List';
170169
}
171170
if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
172-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
171+
$testPlayback = $false
172+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Security.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
173+
if ($testPlayback) {
174+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
175+
} else {
176+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
177+
}
173178
}
174179
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
175180
[Microsoft.Azure.PowerShell.Cmdlets.Security.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/Security/Security.Autorest/exports/Get-AzSecurityConnectorGitHubOwnerAvailable.ps1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ param(
6363
[Parameter(DontShow)]
6464
[Microsoft.Azure.PowerShell.Cmdlets.Security.Category('Runtime')]
6565
[System.Management.Automation.SwitchParameter]
66-
# Wait forNET debugger to attach
66+
# Wait for .NET debugger to attach
6767
${Break},
6868

6969
[Parameter(DontShow)]
@@ -129,7 +129,13 @@ begin {
129129
List = 'Az.Security.private\Get-AzSecurityConnectorGitHubOwnerAvailable_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.Security.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.Security.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/Security/Security.Autorest/exports/Get-AzSecurityConnectorGitHubRepo.ps1

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ param(
9393
[Microsoft.Azure.PowerShell.Cmdlets.Security.Category('Path')]
9494
[Microsoft.Azure.PowerShell.Cmdlets.Security.Models.ISecurityIdentity]
9595
# Identity Parameter
96-
# .
9796
${InputObject},
9897

9998
[Parameter()]
@@ -108,7 +107,7 @@ param(
108107
[Parameter(DontShow)]
109108
[Microsoft.Azure.PowerShell.Cmdlets.Security.Category('Runtime')]
110109
[System.Management.Automation.SwitchParameter]
111-
# Wait forNET debugger to attach
110+
# Wait for .NET debugger to attach
112111
${Break},
113112

114113
[Parameter(DontShow)]
@@ -176,7 +175,13 @@ begin {
176175
List = 'Az.Security.private\Get-AzSecurityConnectorGitHubRepo_List';
177176
}
178177
if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
179-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
178+
$testPlayback = $false
179+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Security.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
180+
if ($testPlayback) {
181+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
182+
} else {
183+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
184+
}
180185
}
181186
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
182187
[Microsoft.Azure.PowerShell.Cmdlets.Security.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

0 commit comments

Comments
 (0)