The Internet did not have an answer to this one, but now it does 🙂
https://gist.github.com/morgansimonsen/2b63bdfdec889a2faf7903061deddc17
M
The Internet did not have an answer to this one, but now it does 🙂
https://gist.github.com/morgansimonsen/2b63bdfdec889a2faf7903061deddc17
M
I recently had the need to copy some Azure managed disks to another region. Since managed disks are not backed by storage accounts like unmanaged disks, you cannot simply do a blob copy and be done. You have to copy your managed disk to a temporary storage account in your target region and create a managed disk from it.
I could not find something that did what I wanted, so I had to roll my own in the form of a PowerShell script. The script does the following:
Important notes:
https://gist.github.com/morgansimonsen/203983b7c52d1fce497c3a9fd4c24b21
M
It has always irritated me that I cannot export data from the disk management snap-in in Windows. Take this example from an Exchange server:
It would be very nice to be able to export this data to a CSV to create a quick storage report. Unfortunately you can’t. But with PowerShell you can!
This command will export the same data:
Get-WmiObject win32_volume | select Name,Label,@{Name=”Capacity (GB)”; Expression={“{0:N2}” –f ($_.capacity/1GB)}},@{Name=”Free Space (GB)”; Expression={“{0:N2}” -f ($_.freespace/1GB)}},@{Name=”Used Space (GB)”; Expression={“{0:N2}” -f ( ($_.capacity/1GB) – ($_.freespace/1GB) ) }} | ft –AutoSize
The result:
Name       Label       Capacity (GB) Free Space (GB) Used Space (GB)
—-Â Â Â Â Â Â Â —–Â Â Â Â Â Â Â ————- ————— —————
C:Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 72,50Â Â Â Â Â Â Â Â 18,17Â Â Â Â Â Â Â Â Â Â 54,33
E:LogLUN1 ExchangeLogs 1 249,87Â Â Â Â Â 1 245,32Â Â Â Â Â Â Â 4,55
E:        Exchange    0,97         0,93           0,03
E:DBLUN1Â DBLUN1Â Â Â Â Â Â 2 046,87Â Â Â Â Â 1 358,92Â Â Â Â Â Â Â 687,95
E:DBLUN2Â DBLUN2Â Â Â Â Â Â 2 046,87Â Â Â Â Â 1 467,69Â Â Â Â Â Â Â 579,19
E:DBLUN3Â DBLUN3Â Â Â Â Â Â 2 046,87Â Â Â Â Â 1 527,84Â Â Â Â Â Â Â 519,03
E:DBLUN4Â DBLUN4Â Â Â Â Â Â 499,87Â Â Â Â Â Â Â 375,19Â Â Â Â Â Â Â Â Â 124,68
Of course, you can export this to CSV etc.
https://gist.github.com/morgansimonsen/8040285