Skip to content

Commit d21a70d

Browse files
committed
Updating the output object to match the new Model, & resetting psm1 file to the upstream version
1 parent 6a715bd commit d21a70d

File tree

7 files changed

+34
-10
lines changed

7 files changed

+34
-10
lines changed

src/ResourceManager/Websites/Commands.Websites/Cmdlets/Certificates/GetAzureWebAppCertificate.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
using Microsoft.Azure.Commands.WebApps.Models;
1212
using Microsoft.Azure.Commands.WebApps.Models.WebApp;
1313
using Microsoft.Azure.Commands.WebApps.Utilities;
14+
using System.Collections.Generic;
1415
using System.Management.Automation;
1516

1617
namespace Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps
@@ -33,7 +34,13 @@ public class GetAzureWebAppCertificate : WebAppBaseClientCmdLet
3334

3435
protected override void ProcessRecord()
3536
{
36-
WriteObject(CmdletHelpers.GetCertificates(this.ResourcesClient, this.WebsitesClient, ResourceGroupName, Thumbprint));
37+
var certificates = CmdletHelpers.GetCertificates(this.ResourcesClient, this.WebsitesClient, ResourceGroupName, Thumbprint);
38+
var output = new List<PSCertificate>();
39+
foreach (var certificate in certificates)
40+
{
41+
output.Add(new PSCertificate(certificate));
42+
}
43+
WriteObject(certificates);
3744
}
3845
}
3946
}

src/ResourceManager/Websites/Commands.Websites/Cmdlets/DeploymentSlots/GetAzureWebAppSlot.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
using Microsoft.Azure.Commands.WebApps.Models;
1919
using Microsoft.Azure.Commands.WebApps.Utilities;
2020
using Microsoft.Azure.Management.WebSites.Models;
21+
using System.Collections.Generic;
2122
using System.Management.Automation;
2223

2324
namespace Microsoft.Azure.Commands.WebApps.Cmdlets.DeploymentSlots
@@ -66,11 +67,17 @@ public override void ExecuteCmdlet()
6667

6768
if (string.IsNullOrWhiteSpace(Slot))
6869
{
69-
WriteObject(WebsitesClient.ListWebApps(ResourceGroupName, Name), true);
70+
var output = WebsitesClient.ListWebApps(ResourceGroupName, Name);
71+
var slots = new List<PSSite>();
72+
foreach(var slot in output)
73+
{
74+
slots.Add(new PSSite(slot));
75+
}
76+
WriteObject(slots, true);
7077
}
7178
else
7279
{
73-
WriteObject(WebsitesClient.GetWebApp(ResourceGroupName, Name, Slot));
80+
WriteObject(new PSSite(WebsitesClient.GetWebApp(ResourceGroupName, Name, Slot)));
7481
}
7582
}
7683
}

src/ResourceManager/Websites/Commands.Websites/Cmdlets/DeploymentSlots/StartAzureWebAppSlot.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public override void ExecuteCmdlet()
2929
{
3030
base.ExecuteCmdlet();
3131
WebsitesClient.StartWebApp(ResourceGroupName, Name, Slot);
32-
WriteObject(WebsitesClient.GetWebApp(ResourceGroupName, Name, Slot));
32+
WriteObject(new PSSite(WebsitesClient.GetWebApp(ResourceGroupName, Name, Slot)));
3333
}
3434
}
3535
}

src/ResourceManager/Websites/Commands.Websites/Cmdlets/WebApps/GetAzureWebApp.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,14 @@ private void GetByLocation()
227227

228228
private void GetByAppServicePlan()
229229
{
230-
WriteObject(WebsitesClient.ListWebAppsForAppServicePlan(AppServicePlan.ResourceGroup,
231-
AppServicePlan.Name).ToList(), true);
230+
var sites = new List<PSSite>();
231+
var output = WebsitesClient.ListWebAppsForAppServicePlan(AppServicePlan.ResourceGroup, AppServicePlan.Name);
232+
foreach (var site in output)
233+
{
234+
sites.Add(new PSSite(site));
235+
}
236+
237+
WriteObject(sites, true);
232238
}
233239
}
234240
}

src/ResourceManager/Websites/Commands.Websites/Cmdlets/WebApps/NewAzureWebApp.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public void CreateWithClonedWebApp()
203203
WriteVerboseWithTimestamp("Cloning source web app '{0}' to destination web app {1}", srcwebAppName, Name);
204204
}
205205

206-
WriteObject(WebsitesClient.CreateWebApp(ResourceGroupName, Name, null, Location, AppServicePlan, cloningInfo, AseName, AseResourceGroupName));
206+
WriteObject(new PSSite(WebsitesClient.CreateWebApp(ResourceGroupName, Name, null, Location, AppServicePlan, cloningInfo, AseName, AseResourceGroupName)));
207207

208208
if (cloneWebAppSlots)
209209
{
@@ -388,7 +388,7 @@ public async Task CreateWithSimpleParameters(IAsyncCmdlet adapter)
388388
repoPath,
389389
exception.Message));
390390
}
391-
adapter.WriteObject(output);
391+
adapter.WriteObject(new PSSite(output));
392392
}
393393

394394

src/ResourceManager/Websites/documentation/upcoming-breaking-changes.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,15 @@
2626
-->
2727

2828
# Upcoming Breaking Changes
29-
29+
## Release 6.0.0 - May 2018
3030

3131
The following cmdlets were affected by this release:
3232

33-
## Release 6.0.0 - May 2018
33+
**Get-AzureRmAppServicePlan**
34+
- Output type changed from ServerFarmWithRichSku to AppServicePlan
35+
36+
**Set-AzureRmAppServicePlan**
37+
- Output type changed from ServerFarmWithRichSku to AppServicePlan
3438

3539
**New-AzureRmAppServicePlan**
3640
- Output type changed from ServerFarmWithRichSku to AppServicePlan

tools/AzureRM/AzureRM.psm1

-512 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)