Skip to content

Commit fef7802

Browse files
authored
Merge pull request #4713 from KoenZomers/EnterpriseAppInsightsReports
Added `Get-PnPEnterpriseAppInsightsReport` and `Start-PnPEnterpriseAppInsightsReport`
2 parents 8bca08f + 1336da5 commit fef7802

File tree

330 files changed

+1013
-647
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

330 files changed

+1013
-647
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
5555
- Added `Get-PnPTenantPronounsSetting` and `Set-PnPTenantPronounsSetting` cmdlets to manage the availability of using pronouns in the organization [#4660](https://github.com/pnp/powershell/pull/4660)
5656
- Added `HidePeopleWhoHaveListsOpen` parameter to `Set-PnPSite` cmdlet to hide people who simultaneously have lists open [#4699](https://github.com/pnp/powershell/pull/4699)
5757
- 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)
58+
- Added `Start-PnPEnterpriseAppInsightsReport` and `Get-PnPEnterpriseAppInsightsReport` which allow working with App Insights repors [#4713](https://github.com/pnp/powershell/pull/4713)
5859

5960
### Changed
6061

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
Module Name: PnP.PowerShell
3+
schema: 2.0.0
4+
applicable: SharePoint Online
5+
online version: https://pnp.github.io/powershell/cmdlets/Get-PnPEnterpriseAppInsightsReport.html
6+
external help file: PnP.PowerShell.dll-Help.xml
7+
title: Get-PnPEnterpriseAppInsightsReport
8+
---
9+
10+
# Get-PnPEnterpriseAppInsightsReport
11+
12+
## SYNOPSIS
13+
14+
**Required Permissions**
15+
16+
* Microsoft SharePoint API: Sites.ReadWrite.All
17+
18+
Checks for the status of the generation of the App Insights reports and allows downloading them when they're done.
19+
20+
## SYNTAX
21+
22+
### Details on all available reports
23+
24+
```powershell
25+
Get-PnPEnterpriseAppInsightsReport
26+
```
27+
28+
### Details on a specific report
29+
30+
```powershell
31+
Get-PnPEnterpriseAppInsightsReport -ReportId <string>
32+
```
33+
34+
### Download a report
35+
36+
```powershell
37+
Get-PnPEnterpriseAppInsightsReport -ReportId <string> -Action Download
38+
```
39+
40+
## DESCRIPTION
41+
42+
This cmdlet allows checking for the status of generated App Insights reports. Only one report can exist for every supported timespan `day, 7 days, 14 days, or 28 days. New requests for reports can be initiated using [Start-PnPEnterpriseAppInsightsReport](Get-PnPEnterpriseAppInsightsReport.md) and will overwrite any existing reports thay may exist.
43+
44+
This cmdlet also allows for downloading of the report data when the report is ready.
45+
46+
## EXAMPLES
47+
48+
### EXAMPLE 1
49+
```powershell
50+
Get-PnPEnterpriseAppInsightsReport
51+
```
52+
53+
Will return all reports that have been generated or are still being generated.
54+
55+
### EXAMPLE 2
56+
```powershell
57+
Get-PnPEnterpriseAppInsightsReport -ReportId bed8845f-72ba-43ec-b1f3-844ff6a64f28
58+
```
59+
60+
Will return details on the report with the specified ID.
61+
62+
### EXAMPLE 3
63+
```powershell
64+
Get-PnPEnterpriseAppInsightsReport -ReportId bed8845f-72ba-43ec-b1f3-844ff6a64f28 -Action Download
65+
```
66+
67+
Will return the contents of the report with the specified ID as text.
68+
69+
## PARAMETERS
70+
71+
### -ReportId
72+
The amount of days to cover in the report. Valid values are 1, 7, 14, and 28. Default is 1.
73+
74+
```yaml
75+
Type: string
76+
Parameter Sets: Details on a specific report, Download a report
77+
78+
Required: True
79+
Position: Named
80+
Default value: 1
81+
Accept pipeline input: True (ByValue)
82+
Accept wildcard characters: False
83+
```
84+
85+
### -Action
86+
When provided with the value `Download`, the cmdlet will return the contents of the report as text.
87+
88+
```yaml
89+
Type: short
90+
Parameter Sets: Download a report
91+
92+
Required: True
93+
Position: Named
94+
Default value: None
95+
Accept pipeline input: False
96+
Accept wildcard characters: False
97+
```
98+
99+
## RELATED LINKS
100+
101+
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
102+
[Generate App Insights Reports](https://learn.microsoft.com/sharepoint/app-insights)
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
Module Name: PnP.PowerShell
3+
schema: 2.0.0
4+
applicable: SharePoint Online
5+
online version: https://pnp.github.io/powershell/cmdlets/Start-PnPEnterpriseAppInsightsReport.html
6+
external help file: PnP.PowerShell.dll-Help.xml
7+
title: Start-PnPEnterpriseAppInsightsReport
8+
---
9+
10+
# Start-PnPEnterpriseAppInsightsReport
11+
12+
## SYNOPSIS
13+
14+
**Required Permissions**
15+
16+
* Microsoft SharePoint API: Sites.ReadWrite.All
17+
18+
Generates a report for the App Insights data.
19+
20+
## SYNTAX
21+
22+
```powershell
23+
Start-PnPEnterpriseAppInsightsReport [-ReportPeriodInDays <1, 7, 14, 28>]
24+
```
25+
26+
## DESCRIPTION
27+
28+
This cmdlet will start the generation of a new App Insights report. It can generate a report over the past day (default), 7 days, 14 days, or 28 days. It will overwrite any existing report for the same period. The report will be generated in the background. Use [Get-PnPEnterpriseAppInsightsReport](Get-PnPEnterpriseAppInsightsReport.md) to check the status of the report.
29+
30+
## EXAMPLES
31+
32+
### EXAMPLE 1
33+
```powershell
34+
Start-PnPEnterpriseAppInsightsReport
35+
```
36+
37+
A report will be generated which covers the past day.
38+
39+
### EXAMPLE 2
40+
```powershell
41+
Start-PnPEnterpriseAppInsightsReport 28
42+
```
43+
44+
A report will be generated which covers the past 28 days.
45+
46+
## PARAMETERS
47+
48+
### -ReportPeriodInDays
49+
The amount of days to cover in the report. Valid values are 1, 7, 14, and 28. Default is 1.
50+
51+
```yaml
52+
Type: short
53+
Parameter Sets: (All)
54+
55+
Required: True
56+
Position: Named
57+
Default value: 1
58+
Accept pipeline input: True (ByValue)
59+
Accept wildcard characters: False
60+
```
61+
62+
## RELATED LINKS
63+
64+
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
65+
[Generate App Insights Reports](https://learn.microsoft.com/sharepoint/app-insights)

src/Commands/Admin/AddHomeSite.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
namespace PnP.PowerShell.Commands.Admin
77
{
88
[Cmdlet(VerbsCommon.Add, "PnPHomeSite")]
9-
public class AddHomeSite : PnPAdminCmdlet
9+
public class AddHomeSite : PnPSharePointOnlineAdminCmdlet
1010
{
1111
[Alias("Url")]
1212
[Parameter(Mandatory = true)]

src/Commands/Admin/AddHubSiteAssociation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace PnP.PowerShell.Commands.Admin
1010
{
1111
[Cmdlet(VerbsCommon.Add, "PnPHubSiteAssociation")]
12-
public class AddHubSiteAssociation : PnPAdminCmdlet
12+
public class AddHubSiteAssociation : PnPSharePointOnlineAdminCmdlet
1313
{
1414
[Parameter(Mandatory = true)]
1515
public SitePipeBind Site;

src/Commands/Admin/AddHubToHubAssociation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace PnP.PowerShell.Commands.Admin
88
{
99
[Cmdlet(VerbsCommon.Add, "PnPHubToHubAssociation")]
10-
public class AddHubToHubAssociation : PnPAdminCmdlet
10+
public class AddHubToHubAssociation : PnPSharePointOnlineAdminCmdlet
1111
{
1212
const string ParamSet_ById = "By Id";
1313
const string ParamSet_ByUrl = "By Url";

src/Commands/Admin/AddMicrosoft365GroupToSite.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
namespace PnP.PowerShell.Commands.Admin
99
{
1010
[Cmdlet(VerbsCommon.Add, "PnPMicrosoft365GroupToSite")]
11-
public class AddMicrosoft365GroupToSite: PnPAdminCmdlet
11+
public class AddMicrosoft365GroupToSite: PnPSharePointOnlineAdminCmdlet
1212
{
1313
[Parameter(Mandatory = false)]
1414
public string Url;

src/Commands/Admin/AddOrgAssetsLibrary.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
namespace PnP.PowerShell.Commands.Admin
99
{
1010
[Cmdlet(VerbsCommon.Add, "PnPOrgAssetsLibrary")]
11-
public class AddOrgAssetsLibrary : PnPAdminCmdlet
11+
public class AddOrgAssetsLibrary : PnPSharePointOnlineAdminCmdlet
1212
{
1313
[Parameter(Mandatory = true)]
1414
public string LibraryUrl;

src/Commands/Admin/AddOrgNewsSite.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
namespace PnP.PowerShell.Commands.Admin
77
{
88
[Cmdlet(VerbsCommon.Add, "PnPOrgNewsSite")]
9-
public class AddOrgNewsSite : PnPAdminCmdlet
9+
public class AddOrgNewsSite : PnPSharePointOnlineAdminCmdlet
1010
{
1111
[Parameter(Mandatory = true)]
1212
public SitePipeBind OrgNewsSiteUrl;

src/Commands/Admin/AddSiteCollectionAppCatalog.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace PnP.PowerShell.Commands.Admin
88
{
99
[Cmdlet(VerbsCommon.Add, "PnPSiteCollectionAppCatalog")]
10-
public class AddSiteCollectionAppCatalog : PnPAdminCmdlet
10+
public class AddSiteCollectionAppCatalog : PnPSharePointOnlineAdminCmdlet
1111
{
1212
[Parameter(Mandatory = false, ValueFromPipeline = false, Position = 0)]
1313
public SitePipeBind Site;

0 commit comments

Comments
 (0)