Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

Microsoft Azure – Get Azure VM Properties using Azure PowerShell

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

The purpose of using the Azure PowerShell Commands is to quickly analyze the overall properties of VM/VMs at once the filtering the with select and where conditions. To find the properties of an Azure VM, you can perform the following commands in Azure Cloud Shell to get the details. 

Command:

Get-AzVM

Output:

1. Get all properties of an Azure Virtual Machine Server

Use the below command to get all properties of an Azure VM server:

Command:

Get-AzVM -Name "vm_name" -ResourceGroup "resource_group_name"

Example:

Get-AzVM -Name "CloudOpsVM" -ResourceGroup "Cloud-Operations"

Output:

2. Expand the  properties of Azure VM Extensions

Use the below command to expand the complete properties of an Azure VM Extension:

Command:

Get-AzVM -Name "vm_name" -ResourceGroup "resource_group_name" `
| Select -ExpandProperty Extensions

Example:

Get-AzVM -Name "CloudOpsVM" -ResourceGroup "Cloud-Operations" `
| Select -ExpandProperty Extensions

Output:

3. Get the Names of Azure VM Extensions

To get the names of Azure VM extensions, use the below command:

Command:

Get-AzVM -Name "vm_name" -ResourceGroup "resource_group_name" `
| Select -ExpandProperty Extensions `
| Select Name

Example:

Get-AzVM -Name "CloudOpsVM" -ResourceGroup "Cloud-Operations" `
| Select -ExpandProperty Extensions `
| Select Name

Output:

4. Size of an Azure VM 

Use the below command to get the size of an Azure VM:

Command:

Get-AzVM -Name "vm_name" -ResourceGroup "resource_group_name" `
| Select -ExpandProperty HardwareProfile

Example:

Get-AzVM -Name "CloudOpsVM" -ResourceGroup "Cloud-Operations" `
| Select -ExpandProperty HardwareProfile

Output:

My Personal Notes arrow_drop_up
Last Updated : 31 Mar, 2023
Like Article
Save Article
Similar Reads
Related Tutorials