diff --git a/src/Aks/Aks.Autorest/custom/Install-AzAksCliTool.ps1 b/src/Aks/Aks.Autorest/custom/Install-AzAksCliTool.ps1 index d5d66703e225..b850844371a2 100644 --- a/src/Aks/Aks.Autorest/custom/Install-AzAksCliTool.ps1 +++ b/src/Aks/Aks.Autorest/custom/Install-AzAksCliTool.ps1 @@ -175,11 +175,12 @@ Function Install-Kubectl { $Destination = [System.IO.Path]::Combine($env:USERPROFILE, ".azure-kubectl") } - $Destination = Resolve-Path -Path $Destination If (-not (Test-Path -Path $Destination)) { New-Item -Path $Destination -ItemType Directory } + $Destination = Resolve-Path -Path $Destination + If (($Null -Eq $Version) -or ("" -Eq $Version)) { $url = "$baseUrl/stable.txt" @@ -269,11 +270,11 @@ Function Install-Kubelogin { $Destination = [System.IO.Path]::Combine($env:USERPROFILE, ".azure-kubelogin") } - $Destination = Resolve-Path -Path $Destination If (-not (Test-Path -Path $Destination)) { New-Item -Path $Destination -ItemType Directory } + $Destination = Resolve-Path -Path $Destination If (($Null -Eq $Version) -or ("" -Eq $Version)) { $latestVersionInfo = (Invoke-WebRequest -Uri $latestReleaseUrl).Content | ConvertFrom-Json diff --git a/src/Aks/Aks/ChangeLog.md b/src/Aks/Aks/ChangeLog.md index 858f58c4a9ed..e56cfa1e3877 100644 --- a/src/Aks/Aks/ChangeLog.md +++ b/src/Aks/Aks/ChangeLog.md @@ -19,6 +19,7 @@ --> ## Upcoming Release * Removed parameter `DockerBridgeCidr` from `New-AzAksCluster` +* Fixed the resolve path issue in `Install-AzAksCliTool`. [#22853] ## Version 5.5.1 * Fixed the issue of handling `nextLink` in `Set-AzAksCluster`. [#21846]