Skip to content

Instantly share code, notes, and snippets.

@ivanbuzyka
Last active June 9, 2016 06:57
Show Gist options
  • Save ivanbuzyka/b757ad310c69527ed744762757eb7b53 to your computer and use it in GitHub Desktop.
Save ivanbuzyka/b757ad310c69527ed744762757eb7b53 to your computer and use it in GitHub Desktop.
# Shows the information to which storage account belongs a VM #
$disk = Get-AzureDisk | Where-Object { $_.AttachedTo.RoleName -eq "traincore15-3" }
$mediaLink = $disk.MediaLink
$storageAccountName = $mediaLink.Host.Split('.')[0]
Write-Output $storageAccountName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment