Skip to content

Commit 2800cd8

Browse files
committed
Added cmdlet
1 parent 5983cf8 commit 2800cd8

File tree

6 files changed

+255
-0
lines changed

6 files changed

+255
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
5757
- Added `HidePeopleWhoHaveListsOpen` parameter to `Set-PnPSite` cmdlet to hide people who simultaneously have lists open [#4699](https://github.com/pnp/powershell/pull/4699)
5858
- Added `-WhoCanShareAllowListInTenant`, `-LegacyBrowserAuthProtocolsEnabled`, `-EnableDiscoverableByOrganizationForVideos`, `-RestrictedAccessControlforSitesErrorHelpLink`, `-Workflow2010Disabled`, `-AllowSharingOutsideRestrictedAccessControlGroups`, `-HideSyncButtonOnDocLib`, `-HideSyncButtonOnODB`, `-StreamLaunchConfig`, `-EnableMediaReactions`, `-ContentSecurityPolicyEnforcement` and `-DisableSpacesActivation` to `Set-PnPTenant` [#4681](https://github.com/pnp/powershell/pull/4681)
5959
- Added `Start-PnPEnterpriseAppInsightsReport` and `Get-PnPEnterpriseAppInsightsReport` which allow working with App Insights repors [#4713](https://github.com/pnp/powershell/pull/4713)
60+
- Added `Get-PnPMicrosoft365Roadmap` which allows retrieval of the Microsoft 365 Roadmap items
6061

6162
### Changed
6263

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
Module Name: PnP.PowerShell
3+
title: Get-PnPMicrosoft365Roadmap
4+
schema: 2.0.0
5+
applicable: SharePoint Online
6+
external help file: PnP.PowerShell.dll-Help.xml
7+
online version: https://pnp.github.io/powershell/cmdlets/Get-PnPMicrosoft365Roadmap.html
8+
---
9+
10+
# Get-PnPMicrosoft365Roadmap
11+
12+
## SYNOPSIS
13+
14+
**Required Permissions**
15+
16+
* None
17+
18+
Returns all items currently on the Microsoft 365 Roadmap
19+
20+
## SYNTAX
21+
22+
```powershell
23+
Get-PnPMicrosoft365Roadmap [-RoadmapUrl <string>] [-Verbose]
24+
```
25+
26+
## DESCRIPTION
27+
28+
Allows retrieval of the Microsoft 365 Roadmap. Pipe the output to i.e. a Where-Object to filter it down to the desired items. You do not need to be connected to any tenant to utilize this cmdlet.
29+
30+
## EXAMPLES
31+
32+
### EXAMPLE 1
33+
```powershell
34+
Get-PnPMicrosoft365Roadmap
35+
```
36+
37+
Retrieves all the available items currently on the Microsoft 365 Roadmap
38+
39+
### EXAMPLE 2
40+
```powershell
41+
Get-PnPMicrosoft365Roadmap | Where-Object { $_.Status -eq "Rolling out" }
42+
```
43+
44+
Retrieves the items on the Microsoft 365 Roadmap which are currently rolling out
45+
46+
### EXAMPLE 3
47+
```powershell
48+
Get-PnPMicrosoft365Roadmap | Where-Object { $_.Created -ge (Get-Date).AddDays(-7) -or $_.Modified -ge (Get-Date).AddDays(-7) }
49+
```
50+
51+
Retrieves the items on the Microsoft 365 Roadmap which have been added or modified in the last 7 days
52+
53+
## PARAMETERS
54+
55+
### -RoadmapUrl
56+
Allows passing in a custom URL to retrieve the roadmap from. It will use the default value listed below if it is not provided. In most cases you don't want to provide this parameter yourself.
57+
58+
```yaml
59+
Type: String
60+
Parameter Sets: (All)
61+
62+
Required: False
63+
Position: Named
64+
Default value: https://www.microsoft.com/releasecommunications/api/v1/m365
65+
Accept pipeline input: False
66+
Accept wildcard characters: False
67+
```
68+
69+
### -Verbose
70+
When provided, additional debug statements will be shown while executing the cmdlet.
71+
72+
```yaml
73+
Type: SwitchParameter
74+
Parameter Sets: (All)
75+
76+
Required: False
77+
Position: Named
78+
Default value: None
79+
Accept pipeline input: False
80+
Accept wildcard characters: False
81+
```
82+
83+
## RELATED LINKS
84+
85+
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
86+
[Microsoft 365 Roadmap](https://www.microsoft.com/microsoft-365/roadmap)
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text.Json.Serialization;
4+
5+
namespace PnP.PowerShell.Commands.Model.ServiceHealth
6+
{
7+
/// <summary>
8+
/// An item on the Microsoft 365 Roadmap
9+
/// </summary>
10+
public class Microsoft365RoadmapItem
11+
{
12+
/// <summary>
13+
/// The ID of the roadmap item
14+
/// </summary>
15+
[JsonPropertyName("id")]
16+
public int? Id { get; set; }
17+
18+
/// <summary>
19+
/// Title of the roadmap item
20+
/// </summary>
21+
[JsonPropertyName("title")]
22+
public string Title { get; set; }
23+
24+
/// <summary>
25+
/// Description of the roadmap item
26+
/// </summary>
27+
[JsonPropertyName("description")]
28+
public string Description { get; set; }
29+
30+
/// <summary>
31+
/// An optional link to a page holding more information regarding the roadmap item
32+
/// </summary>
33+
[JsonPropertyName("moreInfoLink")]
34+
public string MoreInfoLink { get; set; }
35+
36+
/// <summary>
37+
/// Date at which the roadmap item is expected to become generally available
38+
/// </summary>
39+
[JsonPropertyName("publicDisclosureAvailabilityDate")]
40+
public string PublicDisclosureAvailabilityDate { get; set; }
41+
42+
/// <summary>
43+
/// Date at which the roadmap item is expectedo to become available in preview
44+
/// </summary>
45+
[JsonPropertyName("publicPreviewDate")]
46+
public string PublicPreviewDate { get; set; }
47+
48+
/// <summary>
49+
/// Date and time at which this roadmap item was initially added
50+
/// </summary>
51+
[JsonPropertyName("created")]
52+
public DateTime? Created { get; set; }
53+
54+
/// <summary>
55+
/// Unknown status
56+
/// </summary>
57+
[JsonPropertyName("publicRoadmapStatus")]
58+
public string PublicRoadmapStatus { get; set; }
59+
60+
/// <summary>
61+
/// Rollout status of the roadmap item
62+
/// </summary>
63+
[JsonPropertyName("status")]
64+
public string Status { get; set; }
65+
66+
/// <summary>
67+
/// Date and time at which this roadmap item has last been modified
68+
/// </summary>
69+
[JsonPropertyName("modified")]
70+
public DateTime? Modified { get; set; }
71+
72+
/// <summary>
73+
/// All tags applicable to this roadmap item
74+
/// </summary>
75+
[JsonPropertyName("tags")]
76+
public List<Microsoft365RoadmapTag> Tags { get; set; }
77+
78+
/// <summary>
79+
/// Tags applicable to this roadmap item, categorized by type of tag
80+
/// </summary>
81+
[JsonPropertyName("tagsContainer")]
82+
public Microsoft365RoadmapTagsContainer TagsContainer { get; set; }
83+
}
84+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System.Text.Json.Serialization;
2+
3+
namespace PnP.PowerShell.Commands.Model.ServiceHealth
4+
{
5+
/// <summary>
6+
/// An tag on an item in the Microsoft 365 Roadmap
7+
/// </summary>
8+
public class Microsoft365RoadmapTag
9+
{
10+
[JsonPropertyName("tagName")]
11+
public string TagName { get; set; }
12+
}
13+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using System.Collections.Generic;
2+
using System.Text.Json.Serialization;
3+
4+
namespace PnP.PowerShell.Commands.Model.ServiceHealth
5+
{
6+
/// <summary>
7+
/// A container with tags on an item in the Microsoft 365 Roadmap
8+
/// </summary>
9+
public class Microsoft365RoadmapTagsContainer
10+
{
11+
/// <summary>
12+
/// All tagged products to which the roadmap item applies
13+
/// </summary>
14+
[JsonPropertyName("products")]
15+
public List<Microsoft365RoadmapTag> Products { get; set; }
16+
17+
/// <summary>
18+
/// All tagged cloud instances for which the roadmap item applies
19+
/// </summary>
20+
[JsonPropertyName("cloudInstances")]
21+
public List<Microsoft365RoadmapTag> CloudInstances { get; set; }
22+
23+
/// <summary>
24+
/// All tagged release phases that apply to the roadmap item
25+
/// </summary>
26+
[JsonPropertyName("releasePhase")]
27+
public List<Microsoft365RoadmapTag> ReleasePhase { get; set; }
28+
29+
/// <summary>
30+
/// All platforms for which the roadmap item applies
31+
/// </summary>
32+
[JsonPropertyName("platforms")]
33+
public List<Microsoft365RoadmapTag> Platforms { get; set; }
34+
}
35+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Collections.Generic;
2+
using System.Management.Automation;
3+
using System.Text.Json;
4+
using System.Text.Json.Serialization;
5+
using PnP.PowerShell.Commands.Model.ServiceHealth;
6+
7+
namespace PnP.PowerShell.Commands.ServiceHealth
8+
{
9+
[Cmdlet(VerbsCommon.Get, "PnPMicrosoft365Roadmap")]
10+
[OutputType(typeof(List<Microsoft365RoadmapItem>))]
11+
public class GetMicrosoft365Roadmap : PSCmdlet
12+
{
13+
[Parameter(Mandatory = false)]
14+
public string RoadmapUrl = "https://www.microsoft.com/releasecommunications/api/v1/m365";
15+
16+
protected override void ProcessRecord()
17+
{
18+
WriteVerbose($"Retrieving the Microsoft 365 Roadmap from {RoadmapUrl}");
19+
20+
var response = Framework.Http.PnPHttpClient.Instance.GetHttpClient().GetAsync(RoadmapUrl).GetAwaiter().GetResult();
21+
if (!response.IsSuccessStatusCode)
22+
{
23+
throw new PSInvalidOperationException($"Failed to retrieve the Microsoft 365 Roadmap from {RoadmapUrl}");
24+
}
25+
26+
WriteVerbose("Successfully retrieved the Microsoft 365 Roadmap. Parsing roadmap content.");
27+
28+
var content = response.Content.ReadAsStringAsync().GetAwaiter().GetResult();
29+
var roadmapItems = JsonSerializer.Deserialize<List<Microsoft365RoadmapItem>>(content, new JsonSerializerOptions() { DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, PropertyNamingPolicy = JsonNamingPolicy.CamelCase });
30+
31+
WriteVerbose($"{roadmapItems.Count} item{(roadmapItems.Count != 1 ? "s" : "")} parsed");
32+
33+
WriteObject(roadmapItems, true);
34+
}
35+
}
36+
}

0 commit comments

Comments
 (0)