Skip to content

Commit ab1c18a

Browse files
Migrate ConnectedKubernetes from generation to main (#22789)
* Move ConnectedKubernetes to main * Update ChangeLog.md * Update ChangeLog.md --------- Co-authored-by: NanxiangLiu <[email protected]>
1 parent 8b8a346 commit ab1c18a

39 files changed

+357
-167
lines changed

src/ConnectedKubernetes/Az.ConnectedKubernetes.psd1

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Microsoft Corporation
55
#
6-
# Generated on: 3/6/2023
6+
# Generated on: 10/9/2023
77
#
88

99
@{
@@ -110,10 +110,7 @@ PrivateData = @{
110110
# IconUri = ''
111111

112112
# ReleaseNotes of this module
113-
ReleaseNotes = '* Used Env:HELM_CLIENT_PATH if user defined in cmdlet New-AzConnectedKubernetes and Remove-AzConnectedKubernetes.
114-
* Added support for downloading signed helm v3.6.3 for Windows in cmdlet New-AzConnectedKubernetes and Remove-AzConnectedKubernetes.
115-
* Moved helm release namespace to ''azure-arc-release'' in cmdlet New-AzConnectedKubernetes and Remove-AzConnectedKubernetes.
116-
* Cleaned ''azure-arc-release'' namespace after disconnecting in cmdlet Remove-AzConnectedKubernetes.'
113+
# ReleaseNotes = ''
117114

118115
# Prerelease string of this module
119116
# Prerelease = ''

src/ConnectedKubernetes/ChangeLog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21-
21+
* Added support for custom locations id and correlation Id.
2222
## Version 0.9.0
2323
* Used Env:HELM_CLIENT_PATH if user defined in cmdlet New-AzConnectedKubernetes and Remove-AzConnectedKubernetes.
2424
* Added support for downloading signed helm v3.6.3 for Windows in cmdlet New-AzConnectedKubernetes and Remove-AzConnectedKubernetes.

src/ConnectedKubernetes/ConnectedKubernetes.sln

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.0.31903.59
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{F9DFE2E5-0737-46C1-86AC-233DFED4EA43}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{C32E066F-5E72-4874-A558-AB13E401E0A6}"
77
EndProject
8-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssemblyLoading", "..\Accounts\AssemblyLoading\AssemblyLoading.csproj", "{1D7B550E-A58C-46C3-AAD2-FEB39496C3B3}"
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssemblyLoading", "..\Accounts\AssemblyLoading\AssemblyLoading.csproj", "{77EE74C5-92D2-4A95-9161-0EF8D9A086B0}"
99
EndProject
10-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{BBEF8E98-FA9F-4CA1-AF36-B98FE0BA61DA}"
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{18890B81-9B21-4C5B-8D2A-81F4BCA26ECF}"
1111
EndProject
12-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication.ResourceManager", "..\Accounts\Authentication.ResourceManager\Authentication.ResourceManager.csproj", "{5DB06ECE-C240-4706-A399-664EB6E6A926}"
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication.ResourceManager", "..\Accounts\Authentication.ResourceManager\Authentication.ResourceManager.csproj", "{92FA3ED4-E9B9-4E02-94DF-A856D57D0788}"
1313
EndProject
14-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthenticationAssemblyLoadContext", "..\Accounts\AuthenticationAssemblyLoadContext\AuthenticationAssemblyLoadContext.csproj", "{95AB435B-AD08-449B-9609-D91C5287907D}"
14+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthenticationAssemblyLoadContext", "..\Accounts\AuthenticationAssemblyLoadContext\AuthenticationAssemblyLoadContext.csproj", "{066B6052-01BD-4253-B00E-0C6BB8593E6F}"
1515
EndProject
16-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authenticators", "..\Accounts\Authenticators\Authenticators.csproj", "{9D2CA820-A4B0-41F9-ACFB-C14DAB534C87}"
16+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authenticators", "..\Accounts\Authenticators\Authenticators.csproj", "{24A9988F-1BED-4918-9DB5-1A924A188BEB}"
1717
EndProject
18-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.ConnectedKubernetes", "Az.ConnectedKubernetes.csproj", "{7196C921-D965-4C7A-B278-BCFEC4C60EF3}"
18+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.ConnectedKubernetes", "Az.ConnectedKubernetes.csproj", "{5B896C31-B88A-4633-AB6A-647E255C85FD}"
1919
EndProject
2020
Global
2121
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -26,33 +26,33 @@ Global
2626
HideSolutionNode = FALSE
2727
EndGlobalSection
2828
GlobalSection(ProjectConfigurationPlatforms) = postSolution
29-
{F9DFE2E5-0737-46C1-86AC-233DFED4EA43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
30-
{F9DFE2E5-0737-46C1-86AC-233DFED4EA43}.Debug|Any CPU.Build.0 = Debug|Any CPU
31-
{F9DFE2E5-0737-46C1-86AC-233DFED4EA43}.Release|Any CPU.ActiveCfg = Release|Any CPU
32-
{F9DFE2E5-0737-46C1-86AC-233DFED4EA43}.Release|Any CPU.Build.0 = Release|Any CPU
33-
{1D7B550E-A58C-46C3-AAD2-FEB39496C3B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
34-
{1D7B550E-A58C-46C3-AAD2-FEB39496C3B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
35-
{1D7B550E-A58C-46C3-AAD2-FEB39496C3B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
36-
{1D7B550E-A58C-46C3-AAD2-FEB39496C3B3}.Release|Any CPU.Build.0 = Release|Any CPU
37-
{BBEF8E98-FA9F-4CA1-AF36-B98FE0BA61DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
38-
{BBEF8E98-FA9F-4CA1-AF36-B98FE0BA61DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
39-
{BBEF8E98-FA9F-4CA1-AF36-B98FE0BA61DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
40-
{BBEF8E98-FA9F-4CA1-AF36-B98FE0BA61DA}.Release|Any CPU.Build.0 = Release|Any CPU
41-
{5DB06ECE-C240-4706-A399-664EB6E6A926}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
42-
{5DB06ECE-C240-4706-A399-664EB6E6A926}.Debug|Any CPU.Build.0 = Debug|Any CPU
43-
{5DB06ECE-C240-4706-A399-664EB6E6A926}.Release|Any CPU.ActiveCfg = Release|Any CPU
44-
{5DB06ECE-C240-4706-A399-664EB6E6A926}.Release|Any CPU.Build.0 = Release|Any CPU
45-
{95AB435B-AD08-449B-9609-D91C5287907D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
46-
{95AB435B-AD08-449B-9609-D91C5287907D}.Debug|Any CPU.Build.0 = Debug|Any CPU
47-
{95AB435B-AD08-449B-9609-D91C5287907D}.Release|Any CPU.ActiveCfg = Release|Any CPU
48-
{95AB435B-AD08-449B-9609-D91C5287907D}.Release|Any CPU.Build.0 = Release|Any CPU
49-
{9D2CA820-A4B0-41F9-ACFB-C14DAB534C87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
50-
{9D2CA820-A4B0-41F9-ACFB-C14DAB534C87}.Debug|Any CPU.Build.0 = Debug|Any CPU
51-
{9D2CA820-A4B0-41F9-ACFB-C14DAB534C87}.Release|Any CPU.ActiveCfg = Release|Any CPU
52-
{9D2CA820-A4B0-41F9-ACFB-C14DAB534C87}.Release|Any CPU.Build.0 = Release|Any CPU
53-
{7196C921-D965-4C7A-B278-BCFEC4C60EF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
54-
{7196C921-D965-4C7A-B278-BCFEC4C60EF3}.Debug|Any CPU.Build.0 = Debug|Any CPU
55-
{7196C921-D965-4C7A-B278-BCFEC4C60EF3}.Release|Any CPU.ActiveCfg = Release|Any CPU
56-
{7196C921-D965-4C7A-B278-BCFEC4C60EF3}.Release|Any CPU.Build.0 = Release|Any CPU
29+
{C32E066F-5E72-4874-A558-AB13E401E0A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
30+
{C32E066F-5E72-4874-A558-AB13E401E0A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
31+
{C32E066F-5E72-4874-A558-AB13E401E0A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
32+
{C32E066F-5E72-4874-A558-AB13E401E0A6}.Release|Any CPU.Build.0 = Release|Any CPU
33+
{77EE74C5-92D2-4A95-9161-0EF8D9A086B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
34+
{77EE74C5-92D2-4A95-9161-0EF8D9A086B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
35+
{77EE74C5-92D2-4A95-9161-0EF8D9A086B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
36+
{77EE74C5-92D2-4A95-9161-0EF8D9A086B0}.Release|Any CPU.Build.0 = Release|Any CPU
37+
{18890B81-9B21-4C5B-8D2A-81F4BCA26ECF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
38+
{18890B81-9B21-4C5B-8D2A-81F4BCA26ECF}.Debug|Any CPU.Build.0 = Debug|Any CPU
39+
{18890B81-9B21-4C5B-8D2A-81F4BCA26ECF}.Release|Any CPU.ActiveCfg = Release|Any CPU
40+
{18890B81-9B21-4C5B-8D2A-81F4BCA26ECF}.Release|Any CPU.Build.0 = Release|Any CPU
41+
{92FA3ED4-E9B9-4E02-94DF-A856D57D0788}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
42+
{92FA3ED4-E9B9-4E02-94DF-A856D57D0788}.Debug|Any CPU.Build.0 = Debug|Any CPU
43+
{92FA3ED4-E9B9-4E02-94DF-A856D57D0788}.Release|Any CPU.ActiveCfg = Release|Any CPU
44+
{92FA3ED4-E9B9-4E02-94DF-A856D57D0788}.Release|Any CPU.Build.0 = Release|Any CPU
45+
{066B6052-01BD-4253-B00E-0C6BB8593E6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
46+
{066B6052-01BD-4253-B00E-0C6BB8593E6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
47+
{066B6052-01BD-4253-B00E-0C6BB8593E6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
48+
{066B6052-01BD-4253-B00E-0C6BB8593E6F}.Release|Any CPU.Build.0 = Release|Any CPU
49+
{24A9988F-1BED-4918-9DB5-1A924A188BEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
50+
{24A9988F-1BED-4918-9DB5-1A924A188BEB}.Debug|Any CPU.Build.0 = Debug|Any CPU
51+
{24A9988F-1BED-4918-9DB5-1A924A188BEB}.Release|Any CPU.ActiveCfg = Release|Any CPU
52+
{24A9988F-1BED-4918-9DB5-1A924A188BEB}.Release|Any CPU.Build.0 = Release|Any CPU
53+
{5B896C31-B88A-4633-AB6A-647E255C85FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
54+
{5B896C31-B88A-4633-AB6A-647E255C85FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
55+
{5B896C31-B88A-4633-AB6A-647E255C85FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
56+
{5B896C31-B88A-4633-AB6A-647E255C85FD}.Release|Any CPU.Build.0 = Release|Any CPU
5757
EndGlobalSection
5858
EndGlobal

src/ConnectedKubernetes/build-module.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ $null = New-Item -ItemType Directory -Force -Path $examplesFolder
123123

124124
Write-Host -ForegroundColor Green 'Creating cmdlets for specified models...'
125125
$modelCmdlets = @()
126+
$modelCmdletFolder = Join-Path (Join-Path $PSScriptRoot './custom') 'autogen-model-cmdlets'
127+
if (Test-Path $modelCmdletFolder) {
128+
$null = Remove-Item -Force -Recurse -Path $modelCmdletFolder
129+
}
126130
if ($modelCmdlets.Count -gt 0) {
127131
. (Join-Path $PSScriptRoot 'create-model-cmdlets.ps1')
128132
CreateModelCmdlet($modelCmdlets)

src/ConnectedKubernetes/create-model-cmdlets.ps1

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,13 @@ function CreateModelCmdlet {
2323
}
2424

2525
$ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated\api') 'Models'
26-
$ModuleName = 'ConnectedKubernetes'
2726
$OutputDir = Join-Path $PSScriptRoot 'custom\autogen-model-cmdlets'
2827
$null = New-Item -ItemType Directory -Force -Path $OutputDir
28+
if (''.length -gt 0) {
29+
$ModuleName = ''
30+
} else {
31+
$ModuleName = 'Az.ConnectedKubernetes'
32+
}
2933

3034
$CsFiles = Get-ChildItem -Path $ModelCsPath -Recurse -Filter *.cs
3135
$Content = ''
@@ -64,10 +68,10 @@ function CreateModelCmdlet {
6468
$ObjectType = $Model
6569
$ObjectTypeWithNamespace = "${Namespace}.${ObjectType}"
6670
# remove duplicated module name
67-
if ($ObjectType.StartsWith($ModuleName)) {
71+
if ($ObjectType.StartsWith('ConnectedKubernetes')) {
6872
$ModulePrefix = ''
6973
} else {
70-
$ModulePrefix = $ModuleName
74+
$ModulePrefix = 'ConnectedKubernetes'
7175
}
7276
$OutputPath = Join-Path -ChildPath "New-Az${ModulePrefix}${ObjectType}Object.ps1" -Path $OutputDir
7377

@@ -158,7 +162,7 @@ Create an in-memory object for ${ObjectType}.
158162
.Outputs
159163
${ObjectTypeWithNamespace}
160164
.Link
161-
https://learn.microsoft.com/powershell/module/az.${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object
165+
https://learn.microsoft.com/powershell/module/${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object
162166
#>
163167
function New-Az${ModulePrefix}${ObjectType}Object {
164168
[OutputType('${ObjectTypeWithNamespace}')]
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for license information.
3+
// Code generated by Microsoft (R) AutoRest Code Generator.
4+
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
5+
6+
using System;
7+
8+
namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes
9+
{
10+
/// <summary>A class that contains the module-common code and data.</summary>
11+
public partial class Module
12+
{
13+
partial void AfterCreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, ref Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.HttpPipeline pipeline)
14+
{
15+
pipeline.Append(SendAsync);
16+
}
17+
18+
public async System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> SendAsync(System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.IEventListener callback, Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.ISendAsync next)
19+
{
20+
string correlation_id = Environment.GetEnvironmentVariable("AKS_CORRELATION_ID");
21+
if (!String.IsNullOrEmpty(correlation_id))
22+
{
23+
request.Headers.Remove("x-ms-correlation-request-id");
24+
request.Headers.Add("x-ms-correlation-request-id", correlation_id);
25+
}
26+
return await next.SendAsync(request, callback);
27+
}
28+
}
29+
}

src/ConnectedKubernetes/custom/New-AzConnectedKubernetes.ps1

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,12 @@ function New-AzConnectedKubernetes {
167167
# Resource tags.
168168
${Tag},
169169

170+
[Parameter()]
171+
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Body')]
172+
[System.String]
173+
# OID of 'custom-locations' app.
174+
${CustomLocationsOid},
175+
170176
[Parameter()]
171177
[System.Management.Automation.SwitchParameter]
172178
# Accept EULA of ConnectedKubernetes, legal term will pop up without this parameter provided
@@ -282,6 +288,13 @@ function New-AzConnectedKubernetes {
282288
if ($PSBoundParameters.ContainsKey('SubscriptionId')) {
283289
$CommonPSBoundParameters['SubscriptionId'] = $SubscriptionId
284290
}
291+
if ($PSBoundParameters.ContainsKey('PrivateLinkState') -and ($null -ne $CustomLocationsOid) -and ($CustomLocationsOid -ne '')) {
292+
Write-Warning "The features 'cluster-connect' and 'custom-locations' cannot be enabled for a private link enabled connected cluster."
293+
$CustomLocationsOid = $null
294+
}
295+
if ($PSBoundParameters.ContainsKey('CustomLocationsOid')) {
296+
$Null = $PSBoundParameters.Remove('CustomLocationsOid')
297+
}
285298
$IdentityType = [Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Support.ResourceIdentityType]::SystemAssigned
286299
$PSBoundParameters.Add('IdentityType', $IdentityType)
287300

@@ -477,6 +490,9 @@ function New-AzConnectedKubernetes {
477490
if (-not ([string]::IsNullOrEmpty($KubeContext))) {
478491
$options += " --kube-context $KubeContext"
479492
}
493+
if (-not ([string]::IsNullOrEmpty($CustomLocationsOid))) {
494+
$options += " --set systemDefaultValues.customLocations.oid=$CustomLocationsOid"
495+
}
480496
if (!$NoWait) {
481497
$options += " --wait --timeout $OnboardingTimeout"
482498
$options += "s"

src/ConnectedKubernetes/exports/Get-AzConnectedKubernetes.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ param(
8686
[ValidateNotNull()]
8787
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Azure')]
8888
[System.Management.Automation.PSObject]
89-
# The credentials, account, tenant, and subscription used for communication with Azure.
89+
# The DefaultProfile parameter is not functional.
90+
# Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
9091
${DefaultProfile},
9192

9293
[Parameter(DontShow)]
@@ -138,7 +139,7 @@ begin {
138139
$parameterSet = $PSCmdlet.ParameterSetName
139140

140141
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
141-
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
142+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
142143
}
143144
$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
144145
if ($preTelemetryId -eq '') {
@@ -165,6 +166,10 @@ begin {
165166
}
166167
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
167168
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
169+
if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
170+
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
171+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
172+
}
168173
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
169174
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
170175
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)

src/ConnectedKubernetes/exports/Get-AzConnectedKubernetesUserCredential.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ param(
8989
[ValidateNotNull()]
9090
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Azure')]
9191
[System.Management.Automation.PSObject]
92-
# The credentials, account, tenant, and subscription used for communication with Azure.
92+
# The DefaultProfile parameter is not functional.
93+
# Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
9394
${DefaultProfile},
9495

9596
[Parameter(DontShow)]
@@ -141,7 +142,7 @@ begin {
141142
$parameterSet = $PSCmdlet.ParameterSetName
142143

143144
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
144-
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
145+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
145146
}
146147
$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
147148
if ($preTelemetryId -eq '') {
@@ -166,6 +167,10 @@ begin {
166167
}
167168
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
168169
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
170+
if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
171+
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
172+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
173+
}
169174
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
170175
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
171176
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)

0 commit comments

Comments
 (0)