Installing Azure PowerShell
This guide provides instructions on how to install the Azure PowerShell module. Choose the installation method that best suits your operating system and needs.
For Windows Users
The recommended way to install Azure PowerShell on Windows is by using the Microsoft Store or PowerShellGet.
This method provides automatic updates and is the simplest way to get started.
- Open the Microsoft Store.
- Search for "Azure PowerShell".
- Click "Get" or "Install" to download and install the latest version.
This method is ideal if you need more control or are working in an environment where the Store is not available.
- Open Windows PowerShell as an administrator.
- Ensure you have the latest version of PowerShellGet installed:
                                Install-Module -Name PowerShellGet -Force -AllowClobber
- Install the Azure PowerShell module:
                                Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -ForceUse -Scope AllUsersif you have administrator privileges and want to install for all users.
- If prompted to install from an untrusted repository, type Yand press Enter.
Update-Module -Name AzFor macOS Users
On macOS, the Azure PowerShell module is installed using PowerShellGet.
- Open Terminal.
- Install the Azure PowerShell module:
                            Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force
- If prompted to install from an untrusted repository, type Yand press Enter.
For Linux Users
On Linux distributions, the Azure PowerShell module is installed using PowerShellGet.
- Open your terminal.
- Install the Azure PowerShell module:
                            Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force
- If prompted to install from an untrusted repository, type Yand press Enter.
Verifying Installation
After installation, you can verify that the Azure PowerShell module is installed and working correctly by running the following command in your PowerShell session:
Get-Module -ListAvailable -Name AzThis command should list the installed Azure PowerShell modules. You can also try logging in to your Azure account:
Connect-AzAccountThis will prompt you to sign in to your Azure subscription.
Troubleshooting Common Issues
- Execution Policy: If you encounter issues running scripts, you might need to adjust your execution policy. Run Set-ExecutionPolicy RemoteSigned -Scope CurrentUser.
- Module Not Found: Ensure you have a stable internet connection and that the PowerShell Gallery repository is accessible. Try clearing the PowerShell cache with Save-Module -Name PowerShellGet -Forceand then retry installation.
- Proxy Issues: If you are behind a corporate proxy, you may need to configure proxy settings for PowerShell. Consult your network administrator or PowerShell proxy documentation.