- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to retrieve the Azure VM RAM and CPU size using PowerShell?
Azure VM RAM and CPU size depend on the hardware profile chosen for the VM. In this example, we will retrieve VM (TestMachine2k16) hardware profile and then we can find how much RAM or CPU is allocated to it.
To get the Size of the Azure VM,
PS C:\> $azvm = Get-AzVM -VMName 'TestMachine2k16' PS C:\> $azvm.HardwareProfile.VmSize
Output
Standard_DS2_v2
You can check the above size on the Microsoft Azure website to know how much RAM and CPU are associated with it and another way using the PowerShell by using the Get-AZVmSize command.
PS C:\> $vmsize = $azvm.HardwareProfile.VmSize PS C:\> Get-AzVMSize -VMName $azvm.Name -ResourceGroupName $azvm.ResourceGroupName | where{$_.Name -eq $vmsize}
Output
You can see that the CPU allocated is 2, RAM is 7168 MB.
- Related Articles
- How to retrieve the Azure VM resource group using PowerShell?
- How to retrieve the Azure VM Subscription Name using PowerShell?
- How to retrieve the Azure VM NIC name using PowerShell?
- How to retrieve the Azure VM vNet name using PowerShell?
- How to retrieve the Azure VM deallocated date using PowerShell?
- How to retrieve the Azure VM nic name using Azure CLI in PowerShell?
- How to retrieve the OS of the Azure VM using Azure CLI in PowerShell?
- How to get the Azure VM Size using Azure CLI in PowerShell?
- How to retrieve the Operating system of the Azure VM using PowerShell?
- How to retrieve the Azure VM network security group (NSG) using PowerShell?
- How to get the available azure VM size using Azure CLI in PowerShell?
- How to change the size of the Azure VM using PowerShell?
- How to retrieve the OS caching setting of Azure VM using Azure\nCLI in PowerShell?
- How to deallocate the Azure VM using Azure CLI in PowerShell?
- How to start the Azure VM using Azure CLI in PowerShell?

Advertisements