@@ -25,22 +25,22 @@ Get-AzConnectedKubernetesUserCredential -ClusterName azps_test_cluster -Resource
2525Get-AzConnectedKubernetesUserCredential -ClusterName azps_test_cluster -ResourceGroupName azps_test_group -AuthenticationMethod Token -ClientProxy:$false
2626
2727. Inputs
28- Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20240715Preview. IListClusterUserCredentialProperties
28+ Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.IListClusterUserCredentialProperties
2929. Outputs
30- Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20240715Preview. ICredentialResults
30+ Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.ICredentialResults
3131. Notes
3232COMPLEX PARAMETER PROPERTIES
3333
3434To 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
3636PROPERTY <IListClusterUserCredentialProperties>: .
37- AuthenticationMethod <AuthenticationMethod >: The mode of client authentication.
37+ AuthenticationMethod <String >: The mode of client authentication.
3838 ClientProxy <Boolean>: Boolean value to indicate whether the request is for client side proxy or not
3939. Link
4040https://learn.microsoft.com/powershell/module/az.connectedkubernetes/get-azconnectedkubernetesusercredential
4141#>
4242function Get-AzConnectedKubernetesUserCredential {
43- [OutputType ([Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20240715Preview. ICredentialResults ])]
43+ [OutputType ([Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.ICredentialResults ])]
4444[CmdletBinding (DefaultParameterSetName = ' ListExpanded' , PositionalBinding = $false , SupportsShouldProcess , ConfirmImpact = ' Medium' )]
4545param (
4646 [Parameter (Mandatory )]
@@ -66,15 +66,14 @@ param(
6666
6767 [Parameter (ParameterSetName = ' List' , Mandatory , ValueFromPipeline )]
6868 [Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category (' Body' )]
69- [Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20240715Preview. IListClusterUserCredentialProperties ]
69+ [Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.IListClusterUserCredentialProperties ]
7070 # .
71- # To construct, see NOTES section for PROPERTY properties and create a hash table.
7271 ${Property} ,
7372
7473 [Parameter (ParameterSetName = ' ListExpanded' , Mandatory )]
75- [ArgumentCompleter ([ Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Support.AuthenticationMethod ] )]
74+ [Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.PSArgumentCompleterAttribute ( " Token " , " AAD " )]
7675 [Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category (' Body' )]
77- [Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Support.AuthenticationMethod ]
76+ [System.String ]
7877 # The mode of client authentication.
7978 ${AuthenticationMethod} ,
8079
@@ -84,6 +83,18 @@ param(
8483 # Boolean value to indicate whether the request is for client side proxy or not
8584 ${ClientProxy} ,
8685
86+ [Parameter (ParameterSetName = ' ListViaJsonFilePath' , Mandatory )]
87+ [Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category (' Body' )]
88+ [System.String ]
89+ # Path of Json file supplied to the List operation
90+ ${JsonFilePath} ,
91+
92+ [Parameter (ParameterSetName = ' ListViaJsonString' , Mandatory )]
93+ [Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category (' Body' )]
94+ [System.String ]
95+ # Json string supplied to the List operation
96+ ${JsonString} ,
97+
8798 [Parameter ()]
8899 [Alias (' AzureRMContext' , ' AzureCredential' )]
89100 [ValidateNotNull ()]
@@ -140,6 +151,15 @@ begin {
140151 $PSBoundParameters [' OutBuffer' ] = 1
141152 }
142153 $parameterSet = $PSCmdlet.ParameterSetName
154+
155+ $testPlayback = $false
156+ $PSBoundParameters [' HttpPipelinePrepend' ] | Foreach-Object { if ($_ ) { $testPlayback = $testPlayback -or (' Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.PipelineMock' -eq $_.Target.GetType ().FullName -and ' Playback' -eq $_.Target.Mode ) } }
157+
158+ $context = Get-AzContext
159+ if (-not $context -and -not $testPlayback ) {
160+ Write-Error " No Azure login detected. Please run 'Connect-AzAccount' to log in."
161+ exit
162+ }
143163
144164 if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet ]::PowerShellVersion) {
145165 [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet ]::PowerShellVersion = $PSVersionTable.PSVersion.ToString ()
@@ -161,10 +181,10 @@ begin {
161181 $mapping = @ {
162182 List = ' Az.ConnectedKubernetes.private\Get-AzConnectedKubernetesUserCredential_List' ;
163183 ListExpanded = ' Az.ConnectedKubernetes.private\Get-AzConnectedKubernetesUserCredential_ListExpanded' ;
184+ ListViaJsonFilePath = ' Az.ConnectedKubernetes.private\Get-AzConnectedKubernetesUserCredential_ListViaJsonFilePath' ;
185+ ListViaJsonString = ' Az.ConnectedKubernetes.private\Get-AzConnectedKubernetesUserCredential_ListViaJsonString' ;
164186 }
165- if ((' List' , ' ListExpanded' ) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey (' SubscriptionId' )) {
166- $testPlayback = $false
167- $PSBoundParameters [' HttpPipelinePrepend' ] | Foreach-Object { if ($_ ) { $testPlayback = $testPlayback -or (' Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.PipelineMock' -eq $_.Target.GetType ().FullName -and ' Playback' -eq $_.Target.Mode ) } }
187+ if ((' List' , ' ListExpanded' , ' ListViaJsonFilePath' , ' ListViaJsonString' ) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey (' SubscriptionId' ) ) {
168188 if ($testPlayback ) {
169189 $PSBoundParameters [' SubscriptionId' ] = . (Join-Path $PSScriptRoot ' ..' ' utils' ' Get-SubscriptionIdTestSafe.ps1' )
170190 } else {
@@ -178,6 +198,9 @@ begin {
178198 [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet ]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name )
179199 }
180200 $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand (($mapping [$parameterSet ]), [System.Management.Automation.CommandTypes ]::Cmdlet)
201+ if ($wrappedCmd -eq $null ) {
202+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand (($mapping [$parameterSet ]), [System.Management.Automation.CommandTypes ]::Function)
203+ }
181204 $scriptCmd = {& $wrappedCmd @PSBoundParameters }
182205 $steppablePipeline = $scriptCmd.GetSteppablePipeline ($MyInvocation.CommandOrigin )
183206 $steppablePipeline.Begin ($PSCmdlet )
0 commit comments