Ejemplo n.º 1
0
 public override void ExecuteCmdlet()
 {
     ConfirmAction(
         Force.IsPresent,
         string.Format(Resources.RemoveWebsiteWarning, Name),
         Resources.RemoveWebsiteMessage,
         Name,
         () =>
     {
         Site websiteObject = WebsitesClient.GetWebsite(Name);
         WebsitesClient.DeleteWebsite(websiteObject.WebSpace, Name);
         Cache.RemoveSite(CurrentSubscription.SubscriptionId, websiteObject);
     });
 }
Ejemplo n.º 2
0
 public override void ExecuteCmdlet()
 {
     ConfirmAction(
         Force.IsPresent,
         string.Format(Resources.RemoveWebsiteWarning, Name),
         Resources.RemoveWebsiteMessage,
         Name,
         () =>
     {
         try
         {
             Site websiteObject = WebsitesClient.GetWebsite(Name, Slot);
             WebsitesClient.DeleteWebsite(websiteObject.WebSpace, Name, Slot);
             Cache.RemoveSite(CurrentContext.Subscription.Id.ToString(), websiteObject);
         }
         catch (CloudException)
         {
             // Ignore exception the website slot was deleted when deleting the production.
         }
     });
 }