Question 1 of 30
In a PowerShell environment, a system administrator is tasked with managing Azure resources efficiently. They need to retrieve a list of all virtual machines in a specific resource group and filter the results to show only those that are currently running. Which cmdlet should the administrator use to achieve this, and what additional parameters might be necessary to ensure the output is concise and relevant?
Get-AzVM -ResourceGroupName "MyResourceGroup" | Where-Object { $_.PowerState -eq "running" }
Get-AzVM -ResourceGroup "MyResourceGroup" | Filter-VMState "running"
Get-AzVirtualMachine -GroupName "MyResourceGroup" | Select-RunningVM
Get-VM -ResourceGroup "MyResourceGroup" | Where-Object { $_.Status -eq "Active" }

Preparing for Microsoft AZ-900 Microsoft Azure Fundamentals? Now land the interview.

73% of qualified candidates get rejected because of weak resumes. Build an ATS-optimized, recruiter-ready resume in under 5 minutes - free to start.

Build My Resume Free