title: Getting Drive letter from volume id on windows 2016 EC2 -Powershell
body: <p>Is it any simple way to get the EBS volume id for particular drive letter/label?</p>
  
  <p>I am doing this which is just giving the volume IDs but not able to figure out how to get drive letters.</p>
  
  <pre><code># Get Instance ID from the EC2 metadata web service
  $instanceID = (New-Object System.Net.WebClient).DownloadString("http://169.254.169.254/latest/meta-data/instance-id")
  # Get a collection of all volumes attached to the instance
  $volumes = @(get-ec2volume) | ? { $_.Attachments.InstanceId -eq $instanceID}
  
  
  # Get a collection of each volume's ID property
  $volumeNames = $volumes | %{$_.attachment.device}
  $volumeNames
  </code></pre>
  
  <p>Actually, I wanted to tag the ebs volume with particular ec2 instance name: and drive letter.</p>