title: How to collect the Azure VM auto-shutdown time using PowerShell?
body: <p>I need to collect the Azure VM auto-shutdown time using PowerShell, but don't know how to get to the necessary resource property so the auto-shutdown time is reflected.</p>
  
  <p>I am getting the following output:</p>
  
  <pre><code>ID:  /subscriptions/12345/resourceGroups/W12RG/providers/Microsoft.Compute/virtualMachines/W12
  
  Name                   ResourceGroupName ResourceType                   Location
  ----                   ----------------- ------------                   --------
  shutdown-computevm-W12 W12RG             Microsoft.DevTestLab/schedules eastus1
  </code></pre>
  
  <pre><code># Retrieve the resource group information
  [array]$ResourceGroupArray = Get-AzureRMVm | Select-Object -Property ResourceGroupName, Name, VmId
  
  foreach ($resourceGroup in $ResourceGroupArray){
      $targetResourceId = (Get-AzureRmVM -ResourceGroupName $resourcegroup.ResourceGroupName -Name $resourceGroup.Name).Id
      $shutdownInformation = Get-AzureRmResource -ResourceGroupName $resourcegroup.ResourceGroupName -ResourceType Microsoft.DevTestLab/schedules |  ft
      Write-Host "ID: " $targetResourceId
      $shutdownInformation
  }
  </code></pre>
  
  <p>I need to collect the auto-shutdown time for the Azure VM</p>