Welcome to the Azure PowerShell documentation. This guide will help you install and start using Azure PowerShell to manage your Azure resources.
The recommended way to install Azure PowerShell is by using the PowerShell Gallery. You can install the latest version by running the following commands:
Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force
This command installs the Az module, which contains all the cmdlets for managing Azure resources. The -Scope CurrentUser flag ensures that you don't need administrative privileges to install.
Get-Module -Name Az -ListAvailable
You should see the installed Az module and its version listed.
Once installed, you need to connect your PowerShell session to your Azure account.
Connect-AzAccount
This command will open a browser window where you can sign in to your Azure account. After successful authentication, your Azure account information will be loaded into your PowerShell session.
Now you can start managing your Azure resources using Azure PowerShell cmdlets. Here are a few common examples:
Get-AzSubscription
Get-AzResourceGroup
New-AzResourceGroup -Name "MyResourceGroup" -Location "East US"
You can find cmdlets related to a specific Azure service using the Get-Command cmdlet.
Get-Command -Module Az.Storage
This will list all cmdlets available in the Az.Storage module.