title: Get-AzSnapshot : Cannot convert 'System.Object[]' to the type 'System.String' required by parameter Specified method is not supported
body: <p>My requirement is to delete snapshots that are older than 7 days with the name like <em>appname-</em>. but before deleting i need to fetch the snapshot data with some names. 
  the script executes and provides some snapshot datas inidtially but in middle thhows below error.
  could someone help me on this.why i got this error message and how to fix</p>
  
  <p>=========================================================================</p>
  
  <blockquote>
    <p>Get-AzSnapshot : Cannot convert 'System.Object[]' to the type 'System.String' required by parameter 'ResourceGroupName'. Specified 
    method is not supported.
    At line:6 char:39
    +     Get-AzSnapshot -ResourceGroupName $resourceGroupName -SnapshotNam ...
    +                                       ~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (:) [Get-AzSnapshot], ParameterBindingException</p>
    
    <h1>    + FullyQualifiedErrorId : CannotConvertArgument,Microsoft.Azure.Commands.Compute.Automation.GetAzureRmSnapshot</h1>
  </blockquote>
  
  <pre><code>$snapshotnames = (Get-AzSnapshot).Name
  
  foreach($snapname in $snapshotnames)
  {
      $resourceGroupName = (Get-AzResource -Name $snapname).ResourceGroupName
      Get-AzSnapshot -ResourceGroupName $resourceGroupName -SnapshotName $snapname  | Where-Object {($_.TimeCreated -eq (Get-Date).AddDays(-3))} &lt;#-and ($_.Name -like '*-2019_*') } | select Name,TimeCreated -Verbose 
  
  }
  </code></pre>