Skip to content

Install-AzAksCliTool does not make the default KubectlInstallDestination/KubeloginInstallDestination paths #22853

@coolhome

Description

@coolhome

Description

Running Install-AzAksCliTool for the first-time results in an exception about the destination folder ~/.azure-kubectl/ and ~/.azure-kubelogin/ not existing.

Issue script & Debug output

PS C:\Users\azureuser\Desktop\k8s> Install-AzAksCliTool
Resolve-Path : Cannot find path 'C:\Users\azureuser\.azure-kubectl' because it does not exist.
At C:\Program Files\WindowsPowerShell\Modules\Az.Aks\5.5.1\Aks.Autorest\custom\Install-AzAksCliTool.ps1:178 char:24
+         $Destination = Resolve-Path -Path $Destination
+                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\azureuser\.azure-kubectl:String) [Resolve-Path], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.ResolvePathCommand

Install-Kubectl : Cannot bind argument to parameter 'Path' because it is null.
At C:\Program Files\WindowsPowerShell\Modules\Az.Aks\5.5.1\Aks.Autorest\custom\Install-AzAksCliTool.ps1:97 char:9
+         Install-Kubectl @KubectlParams
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Install-Kubectl], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Install-Kubectl


### Environment data

```PowerShell
Name                           Value
----                           -----
PSVersion                      5.1.20348.1850
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.20348.1850
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.

Module versions

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     2.13.0     Az.Accounts                         {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault...}
Script     5.5.1      Az.Aks                              {Disable-AzAksAddOn, Enable-AzAksAddOn, Get-AzAksCluster, Get-AzAksNodePool...}

Error output

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions