Skip to content

Commit c15c381

Browse files
Refresh autorest-selected modules from generation to main (#24722)
1 parent 200453a commit c15c381

File tree

163 files changed

+3838
-896
lines changed

Some content is hidden

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

163 files changed

+3838
-896
lines changed

src/Workloads/Workloads.Autorest/Az.Workloads.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.Workloads.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/Workloads/Workloads.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 Workloads service.
44

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

src/Workloads/Workloads.Autorest/exports/Get-AzWorkloadsMonitor.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,13 @@ begin {
167167
List1 = 'Az.Workloads.private\Get-AzWorkloadsMonitor_List1';
168168
}
169169
if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
170-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
170+
$testPlayback = $false
171+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Workloads.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
172+
if ($testPlayback) {
173+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
174+
} else {
175+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
176+
}
171177
}
172178
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
173179
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/Workloads/Workloads.Autorest/exports/Get-AzWorkloadsProviderInstance.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,13 @@ begin {
170170
List = 'Az.Workloads.private\Get-AzWorkloadsProviderInstance_List';
171171
}
172172
if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
173-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
173+
$testPlayback = $false
174+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Workloads.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
175+
if ($testPlayback) {
176+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
177+
} else {
178+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
179+
}
174180
}
175181
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
176182
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/Workloads/Workloads.Autorest/exports/Get-AzWorkloadsSapApplicationInstance.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,13 @@ begin {
169169
List = 'Az.Workloads.private\Get-AzWorkloadsSapApplicationInstance_List';
170170
}
171171
if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
172-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
172+
$testPlayback = $false
173+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Workloads.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
174+
if ($testPlayback) {
175+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
176+
} else {
177+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
178+
}
173179
}
174180
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
175181
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/Workloads/Workloads.Autorest/exports/Get-AzWorkloadsSapCentralInstance.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,13 @@ begin {
167167
List = 'Az.Workloads.private\Get-AzWorkloadsSapCentralInstance_List';
168168
}
169169
if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
170-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
170+
$testPlayback = $false
171+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Workloads.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
172+
if ($testPlayback) {
173+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
174+
} else {
175+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
176+
}
171177
}
172178
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
173179
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/Workloads/Workloads.Autorest/exports/Get-AzWorkloadsSapDatabaseInstance.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,13 @@ begin {
167167
List = 'Az.Workloads.private\Get-AzWorkloadsSapDatabaseInstance_List';
168168
}
169169
if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
170-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
170+
$testPlayback = $false
171+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Workloads.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
172+
if ($testPlayback) {
173+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
174+
} else {
175+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
176+
}
171177
}
172178
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
173179
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/Workloads/Workloads.Autorest/exports/Get-AzWorkloadsSapLandscapeMonitor.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,13 @@ begin {
157157
GetViaIdentity = 'Az.Workloads.private\Get-AzWorkloadsSapLandscapeMonitor_GetViaIdentity';
158158
}
159159
if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
160-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
160+
$testPlayback = $false
161+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Workloads.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
162+
if ($testPlayback) {
163+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
164+
} else {
165+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
166+
}
161167
}
162168
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
163169
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/Workloads/Workloads.Autorest/exports/Get-AzWorkloadsSapVirtualInstance.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,13 @@ begin {
165165
List1 = 'Az.Workloads.private\Get-AzWorkloadsSapVirtualInstance_List1';
166166
}
167167
if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
168-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
168+
$testPlayback = $false
169+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Workloads.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+
}
169175
}
170176
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
171177
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/Workloads/Workloads.Autorest/exports/Invoke-AzWorkloadsSapDiskConfiguration.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,13 @@ begin {
190190
SapViaIdentityExpanded = 'Az.Workloads.private\Invoke-AzWorkloadsSapDiskConfiguration_SapViaIdentityExpanded';
191191
}
192192
if (('SapExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
193-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
193+
$testPlayback = $false
194+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Workloads.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
195+
if ($testPlayback) {
196+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
197+
} else {
198+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
199+
}
194200
}
195201
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
196202
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

0 commit comments

Comments
 (0)