Skip to content

Instantly share code, notes, and snippets.

@MrKevHunter
Created February 15, 2014 12:08
Show Gist options
  • Save MrKevHunter/9018477 to your computer and use it in GitHub Desktop.
Save MrKevHunter/9018477 to your computer and use it in GitHub Desktop.
Read an Azure Sql Server and loop through the databases
function GetServerData($Server,$Name)
{
$Databases = Get-AzureSqlDatabase -ServerName $Server.ServerName
foreach($db in $Databases)
{
if($db.Name -ne "Master"){
$PercentUsed = ($db.SizeMB / ($db.MaxSizeGb * 1024)) * 100
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment