Skip to content

Commit 506ebe1

Browse files
authored
[Aks] Move from generation branch (#19364)
* Move from generation branch * Add ChangeLog.md * Remove the origin Install-AzAksKubectl * Add breaking change exception * Add breaking change exception * Add breaking change exception * Add breaking change exception * Add breaking change exception * Add breaking change exception Co-authored-by: wyunchi-ms <[email protected]>
1 parent 1f135cc commit 506ebe1

File tree

341 files changed

+4146
-2275
lines changed

Some content is hidden

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

341 files changed

+4146
-2275
lines changed

src/Aks/Aks.Autorest/Az.Aks.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

src/Aks/Aks.Autorest/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This directory contains the PowerShell module for the Aks 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.

src/Aks/Aks.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/Aks/Aks.Autorest/create-model-cmdlets.ps1

Lines changed: 4 additions & 2 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.Aks'.Split(".")[1]
26+
$ModuleName = 'Aks'
2727
$OutputDir = Join-Path $PSScriptRoot 'custom\autogen-model-cmdlets'
2828
$null = New-Item -ItemType Directory -Force -Path $OutputDir
2929

@@ -115,7 +115,9 @@ function CreateModelCmdlet {
115115
# check whether completer is needed
116116
$completer = '';
117117
if($Type.Split('.').Split('.')[-2] -eq 'Support') {
118-
$completer += "`n [ArgumentCompleter([${Type}])]"
118+
# If Type is an array, need to strip []
119+
$strippedType = $Type.Replace('[]', '')
120+
$completer += "`n [ArgumentCompleter([${strippedType}])]"
119121
}
120122
$ParameterDefineScript = "
121123
[Parameter($ParameterDefineProperty)]${completer}

0 commit comments

Comments
 (0)