Matching AWS volume ID to its corresponding Windows drive letter is an easy task
using PowerShell.
Win32_DiskDrive holds the info for the volume-ID.
Here’s the script, below enjoy 😊
$get_disks=gwmi -query "SELECT * FROM Win32_DiskDrive"
ForEach($disk
in $get_disks){
$get_partitions=gwmi -query "ASSOCIATORS
OF {Win32_DiskDrive.DeviceID='$($disk.DeviceID)'} WHERE
AssocClass = Win32_DiskDriveToDiskPartition"
ForEach($partition in $get_partitions){
$get_logicaldisks=gwmi -query "ASSOCIATORS
OF {Win32_DiskPartition.DeviceID='$($partition.DeviceID)'} WHERE
AssocClass = Win32_LogicalDiskToPartition"
ForEach($logicaldisk
in $get_logicaldisks){
$insert_the_dash= ($disk.SerialNumber).Insert(3,"-") #insert
dash to match AWS volume
$volume_partition
= "Drive
Letter " + $logicaldisk.DeviceID
+"is equals
to volume: " + $insert_the_dash
Write-Output
$volume_partition
}
}
}
Sample Output:
Drive Letter C: is equals to volume: vol-038460479e0cdcvbn9
Drive Letter H: is equals to volume: vol-0rrg71379xc44fd785
Cheers!
================================
Free Android Apps:
Click links below to find out more:
Excel Keyboard guide:
Heaven's Dew Fall Prayer app for Android :
Catholic Rosary Guide for Android:
Pray the Rosary every day, countless blessings will be showered upon your life if you recite the Rosary faithfully.
https://play.google.com/store/apps/details?id=com.myrosaryapp
https://play.google.com/store/apps/details?id=com.myrosaryapp
Comments
Post a Comment