Skip to content

Commit 404ae3b

Browse files
VeryEarlyazure-powershell-botMoChiliaBethanyZhou
authored
Move Compute to main (#18869)
* Move Compute to main * Update BreakingChangeIssues.csv * Update ChangeLog.md * Update Update-AzRestorePointCollection.md * Update Update-AzGalleryApplicationVersion.md * Update Get-AzVM.md * Update Invoke-AzVMPatchAssessment.md * Update New-AzVM.md * Update New-AzVmss.md * Update Remove-AzVmssGalleryApplication.md * Update Remove-AzVmGalleryApplication.md * Update Set-AzVmssOsProfile.md * Update Remove-AzGalleryApplicationVersion.md * fix example * fix Co-authored-by: azure-powershell-bot <[email protected]> Co-authored-by: Shiying Chen <[email protected]> Co-authored-by: Beisi Zhou <[email protected]>
1 parent 8cfc39d commit 404ae3b

File tree

602 files changed

+22854
-14288
lines changed

Some content is hidden

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

602 files changed

+22854
-14288
lines changed

src/Compute/Compute.Autorest/Az.Compute.format.ps1xml

Lines changed: 542 additions & 294 deletions
Large diffs are not rendered by default.

src/Compute/Compute.Autorest/Az.Compute.psm1

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@
2525
}
2626
}
2727
if(-not $accountsModule) {
28-
$hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.2.3' } | Measure-Object).Count -gt 0
28+
$hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.7.5' } | Measure-Object).Count -gt 0
2929
if($hasAdequateVersion) {
30-
$accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.2.3 -Scope Global -PassThru
30+
$accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.7.5 -Scope Global -PassThru
3131
}
3232
}
3333
}
3434

3535
if(-not $accountsModule) {
36-
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
37-
} elseif (($accountsModule.Version -lt [System.Version]'2.2.3') -and (-not $localAccounts)) {
38-
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
36+
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
37+
} elseif (($accountsModule.Version -lt [System.Version]'2.7.5') -and (-not $localAccounts)) {
38+
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
3939
}
4040
Write-Information "Loaded Module '$($accountsModule.Name)'"
4141

@@ -50,6 +50,10 @@
5050

5151
# Tweaks the pipeline on module load
5252
$instance.OnModuleLoad = $VTable.OnModuleLoad
53+
54+
# Following two delegates are added for telemetry
55+
$instance.GetTelemetryId = $VTable.GetTelemetryId
56+
$instance.Telemetry = $VTable.Telemetry
5357

5458

5559
# Tweaks the pipeline per call
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using System;
16+
using System.Reflection;
17+
using System.Runtime.InteropServices;
18+
19+
[assembly: AssemblyTitle("Microsoft Azure Powershell - Compute")]
20+
[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)]
21+
[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)]
22+
[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)]
23+
24+
[assembly: ComVisible(false)]
25+
[assembly: CLSCompliant(false)]
26+
[assembly: Guid("05e53bbe-85c7-4f90-b796-25b4d044090b")]
27+
[assembly: AssemblyVersion("0.1.0")]
28+
[assembly: AssemblyFileVersion("0.1.0")]

src/Compute/Compute.Autorest/README.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This directory contains the PowerShell module for the Compute service.
1717
This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.
1818

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

2222
## Authentication
2323
AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent.
@@ -29,16 +29,16 @@ For information on how to develop for `Az.Compute`, see [how-to.md](how-to.md).
2929
### AutoRest Configuration
3030
> see https://aka.ms/autorest
3131
``` yaml
32-
branch: 0c887b0c35f6f19468a16e660bba2a9eb5f4a330
32+
branch: 4640dfc655f8641962814663fd03fd667e5c1a88
3333
require:
3434
# readme.azure.noprofile.md is the common configuration file
3535
- $(this-folder)/../../readme.azure.noprofile.md
3636
input-file:
3737
# You need to specify your swagger files here.
38-
- $(repo)/specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/gallery.json
38+
- $(repo)/specification/compute/resource-manager/Microsoft.Compute/stable/2022-01-03/GalleryRP/gallery.json
3939
- $(repo)/specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/runCommands.json
4040
# If the swagger has not been put in the repo, you may uncomment the following line and refer to it locally
41-
module-version: 0.1.0
41+
module-version: 0.2.0
4242
# Normally, title is the service name
4343
title: Compute
4444
subject-prefix: ""
@@ -149,6 +149,18 @@ directive:
149149
parameter-name: PublishingProfileTargetRegion
150150
set:
151151
parameter-name: TargetRegion
152+
- where:
153+
verb: New|Update
154+
subject: GalleryApplicationVersion
155+
parameter-name: SettingConfigFileName
156+
set:
157+
parameter-name: ConfigFileName
158+
- where:
159+
verb: New|Update
160+
subject: GalleryApplicationVersion
161+
parameter-name: SettingPackageFileName
162+
set:
163+
parameter-name: PackageFileName
152164
### END # change parameter names for GalleryApplicationVersion
153165
# hide parameters for New, Update Gallery Application
154166
- where:
@@ -166,7 +178,7 @@ directive:
166178
- where:
167179
verb: Update|New
168180
subject: GalleryApplicationVersion$
169-
parameter-name: PublishingProfileEnableHealthCheck|PublishingProfileStorageAccountType|PublishingProfileReplicationMode
181+
parameter-name: PublishingProfileEnableHealthCheck|PublishingProfileStorageAccountType|PublishingProfileReplicationMode|PublishingProfileTargetExtendedLocation|PublishingProfileAdvancedSetting
170182
hide: true
171183
- where:
172184
verb: Update

src/Compute/Compute.Autorest/check-dependencies.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if(-not $Isolated) {
2525
function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [string]$versionMinimum, [string]$requiredVersion) {
2626
if($predicate) {
2727
$module = Get-Module -ListAvailable -Name $moduleName
28-
if((-not $module) -or ($versionMinimum -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -ge [System.Version]$versionMinimum } | Measure-Object).Count -eq 0)) {
28+
if((-not $module) -or ($versionMinimum -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -ge [System.Version]$versionMinimum } | Measure-Object).Count -eq 0) -or ($requiredVersion -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -eq [System.Version]$requiredVersion } | Measure-Object).Count -eq 0)) {
2929
$null = New-Item -ItemType Directory -Force -Path $path
3030
Write-Host -ForegroundColor Green "Installing local $moduleName module into '$path'..."
3131
if ($requiredVersion) {
@@ -47,7 +47,7 @@ if(Test-Path -Path $localModulesPath) {
4747
$env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath"
4848
}
4949

50-
DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '2.2.3'
50+
DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '2.7.5'
5151
DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -requiredVersion '4.10.1'
5252

5353
$tools = Join-Path $PSScriptRoot 'tools'

src/Compute/Compute.Autorest/create-model-cmdlets.ps1

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function CreateModelCmdlet {
2323
}
2424

2525
$ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated\api') 'Models'
26-
$ModuleName = 'Az.Compute'.Split(".")[1]
26+
$ModuleName = ''
2727
$OutputDir = Join-Path $PSScriptRoot 'custom\autogen-model-cmdlets'
2828
$null = New-Item -ItemType Directory -Force -Path $OutputDir
2929

@@ -112,13 +112,22 @@ function CreateModelCmdlet {
112112
$ParameterDefinePropertyList.Add("HelpMessage=`"${Description}.`"")
113113
}
114114
$ParameterDefineProperty = [System.String]::Join(", ", $ParameterDefinePropertyList)
115+
# check whether completer is needed
116+
$completer = '';
117+
if($Type.Split('.').Split('.')[-2] -eq 'Support') {
118+
# If Type is an array, need to strip []
119+
$strippedType = $Type.Replace('[]', '')
120+
$completer += "`n [ArgumentCompleter([${strippedType}])]"
121+
}
115122
$ParameterDefineScript = "
116-
[Parameter($ParameterDefineProperty)]
123+
[Parameter($ParameterDefineProperty)]${completer}
117124
[${Type}]
118125
`$${Identifier}"
119126
$ParameterDefineScriptList.Add($ParameterDefineScript)
120127
$ParameterAssignScriptList.Add("
121-
`$Object.${Identifier} = `$${Identifier}")
128+
if (`$PSBoundParameters.ContainsKey('${Identifier}')) {
129+
`$Object.${Identifier} = `$${Identifier}
130+
}")
122131
}
123132
}
124133
$ParameterDefineScript = $ParameterDefineScriptList | Join-String -Separator ","
@@ -142,9 +151,9 @@ function CreateModelCmdlet {
142151
143152
<#
144153
.Synopsis
145-
Create a in-memory object for ${ObjectType}
154+
Create an in-memory object for ${ObjectType}.
146155
.Description
147-
Create a in-memory object for ${ObjectType}
156+
Create an in-memory object for ${ObjectType}.
148157
149158
.Outputs
150159
${ObjectTypeWithNamespace}
@@ -167,4 +176,4 @@ ${ParameterAssignScript}
167176
"
168177
Set-Content -Path $OutputPath -Value $Script
169178
}
170-
}
179+
}

src/Compute/Compute.Autorest/custom/New-AzGalleryApplication.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Create or update a gallery Application Definition.
1414
#>
1515

1616
function New-AzGalleryApplication {
17-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Compute.Models.Api20210701.IGalleryApplication])]
17+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Compute.Models.Api20220103.IGalleryApplication])]
1818
[CmdletBinding(PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact = 'Medium')]
1919
param(
2020
[Parameter(Mandatory)]

src/Compute/Compute.Autorest/custom/New-AzGalleryApplicationVersion.ps1

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Create or update a gallery Application Version.
1313
Create or update a gallery Application Version.
1414
#>
1515
function New-AzGalleryApplicationVersion {
16-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Compute.Models.Api20210701.IGalleryApplicationVersion])]
16+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Compute.Models.Api20220103.IGalleryApplicationVersion])]
1717
[CmdletBinding(DefaultParameterSetName = 'CreateExpanded', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact = 'Medium')]
1818
param(
1919
[Parameter(Mandatory)]
@@ -120,7 +120,7 @@ function New-AzGalleryApplicationVersion {
120120
[Parameter()]
121121
[AllowEmptyCollection()]
122122
[Microsoft.Azure.PowerShell.Cmdlets.Compute.Category('Body')]
123-
[Microsoft.Azure.PowerShell.Cmdlets.Compute.Models.Api20210701.ITargetRegion[]]
123+
[Microsoft.Azure.PowerShell.Cmdlets.Compute.Models.Api20220103.ITargetRegion[]]
124124
# The target regions where the Image Version is going to be replicated to.
125125
# This property is updatable.
126126
# To construct, see NOTES section for TARGETREGION properties and create a hash table.
@@ -192,7 +192,25 @@ function New-AzGalleryApplicationVersion {
192192
[Microsoft.Azure.PowerShell.Cmdlets.Compute.Category('Runtime')]
193193
[System.Management.Automation.SwitchParameter]
194194
# Use the default credentials for the proxy
195-
${ProxyUseDefaultCredentials}
195+
${ProxyUseDefaultCredentials},
196+
197+
[Parameter()]
198+
[Microsoft.Azure.PowerShell.Cmdlets.Compute.Category('Body')]
199+
[System.String]
200+
# Optional.
201+
# The name to assign the downloaded package file on the VM.
202+
# This is limited to 4096 characters.
203+
# If not specified, the package file will be named the same as the Gallery Application name.
204+
${PackageFileName},
205+
206+
[Parameter()]
207+
[Microsoft.Azure.PowerShell.Cmdlets.Compute.Category('Body')]
208+
[System.String]
209+
# Optional.
210+
# The name to assign the downloaded config file on the VM.
211+
# This is limited to 4096 characters.
212+
# If not specified, the config file will be named the Gallery Application name appended with "_config".
213+
${ConfigFileName}
196214
)
197215
process {
198216
Az.Compute.internal\New-AzGalleryApplicationVersion @PSBoundParameters

src/Compute/Compute.Autorest/custom/Update-AzGalleryApplicationVersion.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Update a gallery Application Version.
1414
#>
1515

1616
function Update-AzGalleryApplicationVersion {
17-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Compute.Models.Api20210701.IGalleryApplicationVersion])]
17+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Compute.Models.Api20220103.IGalleryApplicationVersion])]
1818
[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
1919
param(
2020
[Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
@@ -98,15 +98,15 @@ function Update-AzGalleryApplicationVersion {
9898

9999
[Parameter()]
100100
[Microsoft.Azure.PowerShell.Cmdlets.Compute.Category('Body')]
101-
[Microsoft.Azure.PowerShell.Cmdlets.Compute.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Compute.Models.Api20210701.IUpdateResourceDefinitionTags]))]
101+
[Microsoft.Azure.PowerShell.Cmdlets.Compute.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Compute.Models.Api20220103.IUpdateResourceDefinitionTags]))]
102102
[System.Collections.Hashtable]
103103
# Resource tags
104104
${Tag},
105105

106106
[Parameter()]
107107
[AllowEmptyCollection()]
108108
[Microsoft.Azure.PowerShell.Cmdlets.Compute.Category('Body')]
109-
[Microsoft.Azure.PowerShell.Cmdlets.Compute.Models.Api20210701.ITargetRegion[]]
109+
[Microsoft.Azure.PowerShell.Cmdlets.Compute.Models.Api20220103.ITargetRegion[]]
110110
# The target regions where the Image Version is going to be replicated to.
111111
# This property is updatable.
112112
# To construct, see NOTES section for TARGETREGION properties and create a hash table.

src/Compute/Compute.Autorest/docs/Get-AzGalleryApplication.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,14 @@ Retrieves information about a gallery Application Definition.
3636

3737
### Example 1: Get a Gallery Application in a Gallery
3838
```powershell
39-
PS C:\> Get-AzGalleryApplication -ResourceGroupName $rgName -GalleryName $galleryName -name $galleryAppName
40-
39+
Get-AzGalleryApplication -ResourceGroupName $rgName -GalleryName $galleryName -name $galleryAppName
4140
```
4241

4342
Retrieve a Gallery Application resource with the provided Resource Group, Gallery, and Gallery Application name.
4443

4544
### Example 2: Get all the Gallery Applications in a Gallery
4645
```powershell
47-
PS C:\> Get-AzGalleryApplication -GalleryName $GalleryName -ResourceGroupName $rgName
48-
46+
Get-AzGalleryApplication -GalleryName $GalleryName -ResourceGroupName $rgName
4947
```
5048

5149
Retrieve all the Gallery Application resources in the provided Resource Group and Gallery.
@@ -153,7 +151,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
153151
154152
## OUTPUTS
155153
156-
### Microsoft.Azure.PowerShell.Cmdlets.Compute.Models.Api20210701.IGalleryApplication
154+
### Microsoft.Azure.PowerShell.Cmdlets.Compute.Models.Api20220103.IGalleryApplication
157155
158156
## NOTES
159157
@@ -164,7 +162,7 @@ COMPLEX PARAMETER PROPERTIES
164162
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.
165163
166164
167-
INPUTOBJECT <IComputeIdentity>: Identity Parameter
165+
`INPUTOBJECT <IComputeIdentity>`: Identity Parameter
168166
- `[CommandId <String>]`: The command id.
169167
- `[GalleryApplicationName <String>]`: The name of the gallery Application Definition to be created or updated. The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 characters.
170168
- `[GalleryApplicationVersionName <String>]`: The name of the gallery Application Version to be created. Needs to follow semantic version name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>

0 commit comments

Comments
 (0)