Skip to content

Migrate VMware from generation to main #19619

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 12 additions & 0 deletions src/VMware/Az.VMware.format.ps1xml
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,12 @@
<TableColumnHeader>
<Label>Name</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Status</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>ProvisioningState</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>ResourceGroupName</Label>
</TableColumnHeader>
Expand All @@ -699,6 +705,12 @@
<TableColumnItem>
<PropertyName>Name</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Status</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>ProvisioningState</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>ResourceGroupName</PropertyName>
</TableColumnItem>
Expand Down
20 changes: 8 additions & 12 deletions src/VMware/Az.VMware.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Generated by: Microsoft Corporation
#
# Generated on: 2/24/2022
# Generated on: 9/26/2022
#

@{
Expand Down Expand Up @@ -71,15 +71,16 @@ FormatsToProcess = './Az.VMware.format.ps1xml'
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = 'Get-AzVMwareAddon', 'Get-AzVMwareAuthorization',
'Get-AzVMwareCloudLink', 'Get-AzVMwareCluster',
'Get-AzVMwareGlobalReachConnection', 'Get-AzVMwarePlacementPolicy',
'Get-AzVMwarePrivateCloud',
'Get-AzVMwareDatastore', 'Get-AzVMwareGlobalReachConnection',
'Get-AzVMwarePlacementPolicy', 'Get-AzVMwarePrivateCloud',
'Get-AzVMwarePrivateCloudAdminCredential',
'Get-AzVMwareVirtualMachine', 'New-AzVMwareAddon',
'New-AzVMwareAddonSrmPropertiesObject',
'New-AzVMwareAddonVrPropertiesObject', 'New-AzVMwareAuthorization',
'New-AzVMwareCloudLink', 'New-AzVMwareCluster',
'New-AzVMwareGlobalReachConnection', 'New-AzVMwarePlacementPolicy',
'New-AzVMwarePrivateCloud', 'New-AzVMwarePrivateCloudNsxtPassword',
'New-AzVMwareDatastore', 'New-AzVMwareGlobalReachConnection',
'New-AzVMwarePlacementPolicy', 'New-AzVMwarePrivateCloud',
'New-AzVMwarePrivateCloudNsxtPassword',
'New-AzVMwarePrivateCloudVcenterPassword',
'New-AzVMwarePSCredentialExecutionParameterObject',
'New-AzVMwareScriptSecureStringExecutionParameterObject',
Expand All @@ -88,7 +89,7 @@ FunctionsToExport = 'Get-AzVMwareAddon', 'Get-AzVMwareAuthorization',
'New-AzVMwareVMPlacementPolicyPropertiesObject',
'Remove-AzVMwareAddon', 'Remove-AzVMwareAuthorization',
'Remove-AzVMwareCloudLink', 'Remove-AzVMwareCluster',
'Remove-AzVMwareGlobalReachConnection',
'Remove-AzVMwareDatastore', 'Remove-AzVMwareGlobalReachConnection',
'Remove-AzVMwarePlacementPolicy', 'Remove-AzVMwarePrivateCloud',
'Test-AzVMwareLocationQuotaAvailability',
'Test-AzVMwareLocationTrialAvailability', 'Update-AzVMwareCluster',
Expand Down Expand Up @@ -130,12 +131,7 @@ PrivateData = @{
# IconUri = ''

# ReleaseNotes of this module
ReleaseNotes = '* Upgrade API version to 2021-12-01
* Added cmdlet:
- ''Get-AzVMwareVirtualMachine''
- ''New-AzVMwarePlacementPolicy''
- ''Update-AzVMwarePlacementPolicy''
- ''Remove-AzVMwarePlacementPolicy'''
# ReleaseNotes = ''

# Prerelease string of this module
# Prerelease = ''
Expand Down
14 changes: 9 additions & 5 deletions src/VMware/Az.VMware.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@
}
}
if(-not $accountsModule) {
$hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.2.3' } | Measure-Object).Count -gt 0
$hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.7.5' } | Measure-Object).Count -gt 0
if($hasAdequateVersion) {
$accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.2.3 -Scope Global -PassThru
$accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.7.5 -Scope Global -PassThru
}
}
}

if(-not $accountsModule) {
Write-Error "`nThis module requires $accountsName version 2.2.3 or greater. For installation instructions, please see: https://docs.microsoft.com/powershell/azure/install-az-ps" -ErrorAction Stop
} elseif (($accountsModule.Version -lt [System.Version]'2.2.3') -and (-not $localAccounts)) {
Write-Error "`nThis module requires $accountsName version 2.2.3 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to add the switch '-RegenerateSupportModule' when executing 'test-module.ps1'. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. For installation instructions, please see: https://docs.microsoft.com/powershell/azure/install-az-ps" -ErrorAction Stop
} elseif (($accountsModule.Version -lt [System.Version]'2.7.5') -and (-not $localAccounts)) {
Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to add the switch '-RegenerateSupportModule' when executing 'test-module.ps1'. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
}
Write-Information "Loaded Module '$($accountsModule.Name)'"

Expand All @@ -50,6 +50,10 @@

# Tweaks the pipeline on module load
$instance.OnModuleLoad = $VTable.OnModuleLoad

# Following two delegates are added for telemetry
$instance.GetTelemetryId = $VTable.GetTelemetryId
$instance.Telemetry = $VTable.Telemetry


# Tweaks the pipeline per call
Expand Down
4 changes: 4 additions & 0 deletions src/VMware/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
- Additional information about change #1
-->
## Upcoming Release
* Added cmdlet:
- `Get-AzVMwareDatastore`
- `New-AzVMwareDatastore`
- `Remove-AzVMwareDatastore`

## Version 0.4.0
* Upgrade API version to 2021-12-01
Expand Down
15 changes: 12 additions & 3 deletions src/VMware/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This directory contains the PowerShell module for the VMware service.
This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.

## Module Requirements
- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.2.3 or greater
- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater

## Authentication
AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent.
Expand Down Expand Up @@ -47,7 +47,7 @@ In this directory, run AutoRest:
> see https://aka.ms/autorest

``` yaml
branch: 69e98508ef71f09851b2a79971d2d8e12560adc5
branch: 2e665b044670074d91e8a9e6d04f23fbe3c8a06e
require:
- $(this-folder)/../readme.azure.noprofile.md
input-file:
Expand Down Expand Up @@ -105,7 +105,7 @@ directive:
hide: true
- where:
verb: Get|New|Remove
subject: ScriptExecution|WorkloadNetworkPublicIP|Datastore
subject: ScriptExecution|WorkloadNetworkPublicIP
hide: true
- where:
verb: Lock
Expand Down Expand Up @@ -217,4 +217,13 @@ directive:
parameter-name: PeerExpressRouteCircuit
set:
parameter-name: PeerExpressRouteResourceId
- where:
model-name: Datastore
set:
format-table:
properties:
- Name
- Status
- ProvisioningState
- ResourceGroupName
```
Loading