![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
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 resource group using PowerShell?
To retrieve the azure VM resource group using PowerShell, we first need to retrieve the Azure VM details using Get-AZVm and then we can use its property called ResourceGroup.
Before getting the details of the Azure VM, make sure that you are connected to the Azure Account using the Connect-AzAccount command.
In this example, we are going to retrieve the Azure VM named TestMachine2k16 to retrieve the VM details.
$azvm = Get-AzVM -Name TestMachine2k16
To get the resource group name, use its property ResourceGroupName.
PS C:\> $azvm.ResourceGroupName ANSIBLETESTRG
Advertisements