MicrosoftDocs / azure-docs-cli

Repository used to store content for the docs.microsoft.com content for the Azure CLI
https://docs.microsoft.com/cli/azure/
Creative Commons Attribution 4.0 International
208 stars 474 forks source link

PATH variable is not updated after the az cli is installed. #4625

Open sriniknms opened 1 week ago

sriniknms commented 1 week ago

Type of issue

Missing information

Feedback

The following script to install azurecli is not updating the PATH variable and needs explicit update for the path variable. Please update the document to reflect the same.

What is present? $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows -OutFile .\AzureCLI.msi; Start-Process msiexec.exe -Wait -ArgumentList '/I AzureCLI.msi /quiet'; Remove-Item .\AzureCLI.msi

What is missing? $env:Path += ";C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin" for x86 $env:Path += ";C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin" for x64

Page URL

https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-windows?tabs=azure-cli

Content source URL

https://github.com/MicrosoftDocs/azure-docs-cli/blob/main/docs-ref-conceptual/install-azure-cli-windows.md

Author

@jiasli

Document Id

2fdd20ef-7bd3-57bc-7957-93f4bb5377ce

dbradish-microsoft commented 1 week ago

@sriniknms, did you close and reopen your terminal after installation? This generally fixes this issue.

sriniknms commented 1 week ago

@dbradish-microsoft it didn't help I have verified the behavior by ensuring that Path variable was not there before installing and after installing also it was not there. Once I added the snippet it was added and closing and re-opening the terminal was able to run the az command, else it will fail with command not recognized.