Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ function Test-AvailabilitySet
Assert-AreEqual $aset.PlatformUpdateDomainCount $nonDefaultUD;
Assert-AreEqual $aset.PlatformFaultDomainCount $nonDefaultFD;

Remove-AzureAvailabilitySet -ResourceGroupName $rgname -Name $asetName;
Assert-ThrowsContains { Remove-AzureAvailabilitySet -ResourceGroupName $rgname -Name $asetName; } "This cmdlet will remove the specified availability set. Do you want to continue?"

Remove-AzureAvailabilitySet -ResourceGroupName $rgname -Name $asetName -Force;

$asets = Get-AzureAvailabilitySet -ResourceGroupName $rgname;
Assert-AreEqual $asets $null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,24 @@ public class RemoveAzureAvailabilitySetCommand : AvailabilitySetBaseCmdlet
[ValidateNotNullOrEmpty]
public string Name { get; set; }

[Parameter(
Position = 2,
HelpMessage = "To force the removal.")]
[ValidateNotNullOrEmpty]
public SwitchParameter Force { get; set; }

public override void ExecuteCmdlet()
{
base.ExecuteCmdlet();

var op = this.AvailabilitySetClient.Delete(this.ResourceGroupName, this.Name);
if (this.Force.IsPresent
|| this.ShouldContinue(Properties.Resources.AvailabilitySetRemovalConfirmation,
Properties.Resources.AvailabilitySetRemovalCaption))
{
var op = this.AvailabilitySetClient.Delete(this.ResourceGroupName, this.Name);

WriteObject(op);
WriteObject(op);
}
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AvailabilitySetRemovalCaption" xml:space="preserve">
<value>Availability set removal operation</value>
</data>
<data name="AvailabilitySetRemovalConfirmation" xml:space="preserve">
<value>This cmdlet will remove the specified availability set. Do you want to continue?</value>
</data>
<data name="BothWindowsAndLinuxConfigurationsSpecified" xml:space="preserve">
<value>Cannot specify both Windows and Linux configurations.</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
vhdName,vhdBlobName,NoOfTimes,md5hash
vhdName, vhdBlobName, NoOfTimes,md5hash
fixed_50.vhd,vhdstore/$guid$.vhd,1,lX67MyV6qURNTCWHDyg8Uw==