Created
April 25, 2013 15:27
-
-
Save RichardSlater/5460609 to your computer and use it in GitHub Desktop.
Set's all Web and Worker roles in a subscription to a single instance.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$deployments = Get-AzureService | | |
Select-Object ServiceName | | |
Get-AzureDeployment | |
$instances = $deployments | | |
Select-Object ServiceName,Slot -ExpandProperty RoleInstanceList | |
$instances | | |
Select-Object ServiceName,Slot,RoleName | | |
Group-Object RoleName,ServiceName,Slot -NoElement | | |
Where-Object {$_.Count -gt 1} | | |
Select-Object Count,@{Name="RoleName"; Expression={$_.Name.Split(',')[0].Trim()}},@{Name="ServiceName";Expression={$_.Name.Split(',')[1].Trim()}},@{Name="Slot";Expression={$_.Name.Split(',')[2].Trim()}} | | |
Set-AzureRole -Count 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment