Skip to content

Commit b316bfb

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

File tree

416 files changed

+8277
-881
lines changed

Some content is hidden

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

416 files changed

+8277
-881
lines changed

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

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

55
---
6-
76
## Info
87
- Modifiable: yes
98
- Generated: all
@@ -48,17 +47,19 @@ In this directory, run AutoRest:
4847
commit: 0baf811c3c76c87b3c127d098519bd97141222dd
4948
require:
5049
- $(this-folder)/../../readme.azure.noprofile.md
51-
input-file:
50+
input-file:
5251
- $(repo)/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/vmware.json
5352

5453
module-version: 0.4.0
5554
title: VMware
5655
subject-prefix: $(service-name)
56+
disable-transform-identity-type: true
57+
flatten-userassignedidentity: false
5758

5859
support-json-input: false
5960

6061
directive:
61-
- from: swagger-document
62+
- from: swagger-document
6263
where: $.definitions.AdminCredentials.properties.nsxtPassword
6364
transform: >-
6465
return {
@@ -68,7 +69,7 @@ directive:
6869
"x-ms-secret": true,
6970
"format": "password"
7071
}
71-
- from: swagger-document
72+
- from: swagger-document
7273
where: $.definitions.AdminCredentials.properties.vcenterPassword
7374
transform: >-
7475
return {
@@ -136,7 +137,7 @@ directive:
136137
# verb: Test
137138
# subject: ^LocationTrialAvailability$
138139
# hide: true
139-
# Remove the list variant as the workloadNetwork only have one enum value
140+
# Remove the list variant as the workloadNetwork only have one enum value
140141
- where:
141142
verb: Get
142143
subject: WorkloadNetwork

src/VMware/VMware.Autorest/exports/Get-AzVMwareAddon.ps1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ COMPLEX PARAMETER PROPERTIES
3333
3434
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
3535
36-
INPUTOBJECT <IVMwareIdentity>: Identity Parameter
36+
INPUTOBJECT <IVMwareIdentity>: Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
3737
[AddonName <String>]: Name of the addon for the private cloud
3838
[AuthorizationName <String>]: Name of the ExpressRoute Circuit Authorization in the private cloud
3939
[CloudLinkName <String>]: Name of the cloud link resource
@@ -183,7 +183,13 @@ begin {
183183
GetViaIdentity = 'Az.VMware.custom\Get-AzVMwareAddon';
184184
}
185185
if (('List', 'Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
186-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
186+
$testPlayback = $false
187+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
188+
if ($testPlayback) {
189+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
190+
} else {
191+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
192+
}
187193
}
188194
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
189195
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/VMware/VMware.Autorest/exports/Get-AzVMwareAuthorization.ps1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,12 @@ param(
130130
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')]
131131
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity]
132132
# Identity Parameter
133-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
134133
${InputObject},
135134

136135
[Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)]
137136
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')]
138137
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity]
139138
# Identity Parameter
140-
# To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table.
141139
${PrivateCloudInputObject},
142140

143141
[Parameter()]
@@ -221,7 +219,13 @@ begin {
221219
List = 'Az.VMware.private\Get-AzVMwareAuthorization_List';
222220
}
223221
if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
224-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
222+
$testPlayback = $false
223+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
224+
if ($testPlayback) {
225+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
226+
} else {
227+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
228+
}
225229
}
226230
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
227231
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/VMware/VMware.Autorest/exports/Get-AzVMwareCloudLink.ps1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,12 @@ param(
130130
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')]
131131
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity]
132132
# Identity Parameter
133-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
134133
${InputObject},
135134

136135
[Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)]
137136
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')]
138137
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity]
139138
# Identity Parameter
140-
# To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table.
141139
${PrivateCloudInputObject},
142140

143141
[Parameter()]
@@ -221,7 +219,13 @@ begin {
221219
List = 'Az.VMware.private\Get-AzVMwareCloudLink_List';
222220
}
223221
if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
224-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
222+
$testPlayback = $false
223+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
224+
if ($testPlayback) {
225+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
226+
} else {
227+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
228+
}
225229
}
226230
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
227231
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/VMware/VMware.Autorest/exports/Get-AzVMwareCluster.ps1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,12 @@ param(
130130
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')]
131131
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity]
132132
# Identity Parameter
133-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
134133
${InputObject},
135134

136135
[Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)]
137136
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')]
138137
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity]
139138
# Identity Parameter
140-
# To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table.
141139
${PrivateCloudInputObject},
142140

143141
[Parameter()]
@@ -221,7 +219,13 @@ begin {
221219
List = 'Az.VMware.private\Get-AzVMwareCluster_List';
222220
}
223221
if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
224-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
222+
$testPlayback = $false
223+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
224+
if ($testPlayback) {
225+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
226+
} else {
227+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
228+
}
225229
}
226230
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
227231
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/VMware/VMware.Autorest/exports/Get-AzVMwareClusterZone.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,13 @@ begin {
135135
List = 'Az.VMware.private\Get-AzVMwareClusterZone_List';
136136
}
137137
if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
138-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
138+
$testPlayback = $false
139+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
140+
if ($testPlayback) {
141+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
142+
} else {
143+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
144+
}
139145
}
140146
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
141147
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/VMware/VMware.Autorest/exports/Get-AzVMwareDatastore.ps1

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,21 +167,18 @@ param(
167167
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')]
168168
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity]
169169
# Identity Parameter
170-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
171170
${InputObject},
172171

173172
[Parameter(ParameterSetName='GetViaIdentityCluster', Mandatory, ValueFromPipeline)]
174173
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')]
175174
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity]
176175
# Identity Parameter
177-
# To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table.
178176
${ClusterInputObject},
179177

180178
[Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)]
181179
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')]
182180
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity]
183181
# Identity Parameter
184-
# To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table.
185182
${PrivateCloudInputObject},
186183

187184
[Parameter()]
@@ -266,7 +263,13 @@ begin {
266263
List = 'Az.VMware.private\Get-AzVMwareDatastore_List';
267264
}
268265
if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
269-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
266+
$testPlayback = $false
267+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
268+
if ($testPlayback) {
269+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
270+
} else {
271+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
272+
}
270273
}
271274
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
272275
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/VMware/VMware.Autorest/exports/Get-AzVMwareGlobalReachConnection.ps1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,12 @@ param(
130130
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')]
131131
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity]
132132
# Identity Parameter
133-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
134133
${InputObject},
135134

136135
[Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)]
137136
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')]
138137
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity]
139138
# Identity Parameter
140-
# To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table.
141139
${PrivateCloudInputObject},
142140

143141
[Parameter()]
@@ -221,7 +219,13 @@ begin {
221219
List = 'Az.VMware.private\Get-AzVMwareGlobalReachConnection_List';
222220
}
223221
if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
224-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
222+
$testPlayback = $false
223+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
224+
if ($testPlayback) {
225+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
226+
} else {
227+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
228+
}
225229
}
226230
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
227231
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

src/VMware/VMware.Autorest/exports/Get-AzVMwarePlacementPolicy.ps1

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,21 +167,18 @@ param(
167167
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')]
168168
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity]
169169
# Identity Parameter
170-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
171170
${InputObject},
172171

173172
[Parameter(ParameterSetName='GetViaIdentityCluster', Mandatory, ValueFromPipeline)]
174173
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')]
175174
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity]
176175
# Identity Parameter
177-
# To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table.
178176
${ClusterInputObject},
179177

180178
[Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)]
181179
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')]
182180
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity]
183181
# Identity Parameter
184-
# To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table.
185182
${PrivateCloudInputObject},
186183

187184
[Parameter()]
@@ -266,7 +263,13 @@ begin {
266263
List = 'Az.VMware.private\Get-AzVMwarePlacementPolicy_List';
267264
}
268265
if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
269-
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
266+
$testPlayback = $false
267+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }
268+
if ($testPlayback) {
269+
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
270+
} else {
271+
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
272+
}
270273
}
271274
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
272275
[Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)

0 commit comments

Comments
 (0)