Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
### Added

### Changed
- Telemetry in PnP PowerShell has been removed due to the costs of collecting the data didn't outweigh the benefits to the PnP PowerShell team to have insights into its usage. The involved cmdlets `Get-PnPPowerShellTelemetryEnabled`, `Enable-PnPPowerShellTelemetry` and `Disable-PnPPowerShellTelemetry` have been marked as deprecated and no longer function, but will stay in v3 for backwards compatibility with existing scripts. These cmdlets will be removed in the next v4 release. All versions of PnP PowerShell will no longer be able to submit telemetry. You might see background requests for this failing. This will not interfear with the normal execution of your PowerShell script. [#5460](https://github.com/pnp/powershell/pull/5460)

### Fixed
- Using UPNs with an apostrophe in it not working with `Remove-PnPUserProfile`, `Export-PnPUserProfile`, `Export-PnPUserInfo`, and `Remove-PnPUserInfo`. The apostrophe is now escaped in the API request. [#5459](https://github.com/pnp/powershell/pull/5459)
Expand Down
1 change: 0 additions & 1 deletion build/Build-Debug.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ if ($LASTEXITCODE -eq 0) {
Copy-Item -Path "$PSScriptRoot/../resources/*.ps1xml" -Destination "$destinationFolder"
# ScriptsToProcess bootstrap that registers the isolated-dependency resolver before the binary module loads.
Copy-Item -Path "$PSScriptRoot/../resources/RegisterPnPAssemblyResolver.ps1" -Destination "$destinationFolder"
Get-ChildItem -Path "$PSScriptRoot/../src/ALC/bin/Debug/net8.0" | Where-Object { $_.Extension -in '.dll', '.pdb' } | Foreach-Object { [void]$commonFiles.Add($_.Name); Copy-Item -LiteralPath $_.FullName -Destination $commonPath }
Get-ChildItem -Path "$PSScriptRoot/../src/Commands/bin/Debug/$configuration" | Where-Object { $_.Extension -in '.dll', '.pdb' } | Foreach-Object {
if ($moduleAssemblies -contains $_.Name -or $_.Name -like 'Microsoft.SharePoint.Client*' -or $_.Name -like 'Microsoft.Online.SharePoint.Client*') {
Copy-Item -LiteralPath $_.FullName -Destination $corePath
Expand Down
4 changes: 1 addition & 3 deletions build/Build-Nightly.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ if ($runPublish -eq $true) {
Copy-Item -Path "$PSscriptRoot/../resources/*.ps1xml" -Destination "$destinationFolder"
# ScriptsToProcess bootstrap that registers the isolated-dependency resolver before the binary module loads.
Copy-Item -Path "$PSscriptRoot/../resources/RegisterPnPAssemblyResolver.ps1" -Destination "$destinationFolder"
Get-ChildItem -Path "$PSScriptRoot/../src/ALC/bin/Release/net8.0" | Where-Object { $_.Extension -in '.dll', '.pdb' } | Foreach-Object { [void]$commonFiles.Add($_.Name); Copy-Item -LiteralPath $_.FullName -Destination $commonPath }
Get-ChildItem -Path "$PSScriptRoot/../src/Commands/bin/Release/net8.0" | Where-Object { $_.Extension -in '.dll', '.pdb' } | Foreach-Object {
if ($moduleAssemblies -contains $_.Name -or $_.Name -like 'Microsoft.SharePoint.Client*' -or $_.Name -like 'Microsoft.Online.SharePoint.Client*') {
Copy-Item -LiteralPath $_.FullName -Destination $corePath
Expand Down Expand Up @@ -294,8 +293,7 @@ if ($runPublish -eq $true) {
Get-Item -LiteralPath "$commonPath/PnP.Core.Admin.dll"
Get-Item -LiteralPath "$commonPath/PnP.Core.Auth.dll"
Get-Item -LiteralPath "$commonPath/PnP.Framework.dll"
Get-Item -LiteralPath "$commonPath/PnP.PowerShell.ALC.dll"
)
)

foreach ($assemblyToBeSigned in $assembliesToBeSigned) {
Invoke-ModuleFileSigning -File $assemblyToBeSigned
Expand Down
2 changes: 0 additions & 2 deletions build/Build-Release.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ Try {
Copy-Item -Path "$PSscriptRoot/../resources/*.ps1xml" -Destination "$destinationFolder"
# ScriptsToProcess bootstrap that registers the isolated-dependency resolver before the binary module loads.
Copy-Item -Path "$PSscriptRoot/../resources/RegisterPnPAssemblyResolver.ps1" -Destination "$destinationFolder"
Get-ChildItem -Path "$PSScriptRoot/../src/ALC/bin/Release/net8.0" | Where-Object { $_.Extension -in '.dll', '.pdb' } | Foreach-Object { [void]$commonFiles.Add($_.Name); Copy-Item -LiteralPath $_.FullName -Destination $commonPath }
Get-ChildItem -Path "$PSScriptRoot/../src/Commands/bin/Release/net8.0" | Where-Object { $_.Extension -in '.dll', '.pdb' } | Foreach-Object {
if ($moduleAssemblies -contains $_.Name -or $_.Name -like 'Microsoft.SharePoint.Client*' -or $_.Name -like 'Microsoft.Online.SharePoint.Client*') {
Copy-Item -LiteralPath $_.FullName -Destination $corePath
Expand Down Expand Up @@ -234,7 +233,6 @@ $assembliesToBeSigned = @(
Get-Item -LiteralPath "$commonPath/PnP.Core.Admin.dll"
Get-Item -LiteralPath "$commonPath/PnP.Core.Auth.dll"
Get-Item -LiteralPath "$commonPath/PnP.Framework.dll"
Get-Item -LiteralPath "$commonPath/PnP.PowerShell.ALC.dll"
)

foreach ($assemblyToBeSigned in $assembliesToBeSigned) {
Expand Down
5 changes: 4 additions & 1 deletion documentation/Disable-PnPPowerShellTelemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ online version: https://pnp.github.io/powershell/cmdlets/Disable-PnPPowerShellTe

# Disable-PnPPowerShellTelemetry

> [!WARNING]
> This cmdlet is deprecated and will be removed in the v4 release.

## SYNOPSIS
Disables sending of telemetry data.

Expand Down Expand Up @@ -60,4 +63,4 @@ Accept wildcard characters: False
```
## RELATED LINKS

[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
5 changes: 4 additions & 1 deletion documentation/Enable-PnPPowerShellTelemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ online version: https://pnp.github.io/powershell/cmdlets/Enable-PnPPowerShellTel

# Enable-PnPPowerShellTelemetry

> [!WARNING]
> This cmdlet is deprecated and will be removed in the v4 release.

## SYNOPSIS
Enables sending of telemetry data.

Expand Down Expand Up @@ -60,4 +63,4 @@ Accept wildcard characters: False
```
## RELATED LINKS

[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
3 changes: 3 additions & 0 deletions documentation/Get-PnPPowerShellTelemetryEnabled.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ online version: https://pnp.github.io/powershell/cmdlets/Get-PnPPowerShellTeleme

# Get-PnPPowerShellTelemetryEnabled

> [!WARNING]
> This cmdlet is deprecated and will be removed in the v4 release.

## SYNOPSIS
Returns true if the PnP PowerShell Telemetry has been enabled.

Expand Down
18 changes: 3 additions & 15 deletions pages/articles/telemetry.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
# Disable or Enable telemetry
# Telemetry in PnP PowerShell

By default PnP PowerShell will report its usage anonymously to the PnP team. We collection information about the **version of PnP PowerShell**, the **operation system version** and the **cmdlet** executed. Notice that we will *not* include parameters used and we will *not* include any values of parameters. We will also *not* be able to trace the execution back to the specific tenant it ran on, the organization it was used for or the person it was run by. Having telemtry in place allows us to get insight in the usage of cmdlets and thereby prioritize work towards the most popular cmdlets.
Up to September 4th, 2026, PnP PowerShell reported its usage anonymously to the PnP team. We collected information about the **version of PnP PowerShell**, the **operation system version** and the **cmdlet** executed. Notice that we did *not* include parameters used and we did *not* include any values of parameters. We were also *not* be able to trace the execution back to the specific tenant it ran on, the organization it was used for or the person it was run by. Having had telemetry in place allowed us to get insight in the usage of cmdlets and thereby prioritize work towards the most popular cmdlets. Over the years the popularity of PnP PowerShell has grown to a level where the costs of collecting and storing all this data became a substantial amount. We have therefore decided to stop collecting this data as the costs no longer outweighed the advantages of us having insights into the usage. The endpoint for the telemetry collection has been removed. Starting with version 3.4.2 the sending of telemetry has been removed from the PowerShell module. Any prior versions will still try to submit telemetry, but submitting the telemetry will no longer succeed. It will not interfere with the normal execution of your PowerShell scripts.

To query if in a connected PnP PowerShell session the telemetry is enabled, use [Get-PnPPowerShellTelemetryEnabled](../cmdlets/Get-PnPPowerShellTelemetryEnabled.md).

If you wish to control telemetry to be sent, you can use one of the below options.

## By using PnP PowerShell
You can disable telemetry to be sent by using [Disable-PnPPowerShellTelemetry](../cmdlets/Disable-PnPPowerShellTelemetry.md).
You can enable telemetry to be sent by using [Enable-PnPPowerShellTelemetry](../cmdlets/Enable-PnPPowerShellTelemetry.md).

## By setting an environment variable
To disable telemetry, set the `PNPPOWERSHELL_DISABLETELEMETRY` environment variable to `true`, i.e. by using `$env:PNPPOWERSHELL_DISABLETELEMETRY=$true`. Remove the entry again or set it to `false` to enable telemetry to be sent again.

## By adding a file in your user profile folder
Alternatively, you can create an empty file called `.pnppowershelltelemetry` inside your home directory (`$env:UserProfile` on Windows, `$env:HOME` on Linux) not needing any content inside of the file to disable telemetry. Remove the file again to enable telemetry to be sent.
The telemetry PnP PowerShell cmlets [Get-PnPPowerShellTelemetryEnabled](../cmdlets/Get-PnPPowerShellTelemetryEnabled.md), [Disable-PnPPowerShellTelemetry](../cmdlets/Disable-PnPPowerShellTelemetry.md) and [Enable-PnPPowerShellTelemetry](../cmdlets/Enable-PnPPowerShellTelemetry.md) have been marked as obsolete in version 3.4.2. They will throw a warning when used and will no longer function, but are being kept in the v3 releases for backwards compatibility so existing scripts using them will not break. In version 4.0.0 onwards, these cmdlets have been removed entirely as they no longer serve purpose.
73 changes: 0 additions & 73 deletions src/ALC/ApplicationInsights.cs

This file was deleted.

13 changes: 0 additions & 13 deletions src/ALC/PnP.PowerShell.ALC.csproj

This file was deleted.

37 changes: 0 additions & 37 deletions src/ALC/TelemetryClient.cs

This file was deleted.

25 changes: 3 additions & 22 deletions src/Commands/Base/DisablePowerShellTelemetry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,16 @@
namespace PnP.PowerShell.Commands.Base
{
[Cmdlet(VerbsLifecycle.Disable, "PnPPowerShellTelemetry")]
[Attributes.ApiPermissionsNotRequired(Remarks = "This cmdlet updates a local file, an environment variable and the telemetry setting of the current connection, and performs no request.")]
[Obsolete("Disable-PnPPowerShellTelemetry is deprecated and will be removed in the next release.")]
[Attributes.ApiPermissionsNotRequired(Remarks = "This cmdlet performs no request.")]
public class DisablePowerShellTelemetry : PnPSharePointCmdlet
{
[Parameter(Mandatory = false)]
public SwitchParameter Force;

protected override void ProcessRecord()
{
var userFolder = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
var telemetryFile = System.IO.Path.Combine(userFolder, ".pnppowershelltelemetry");
if (Force || ShouldContinue("Do you want to disable telemetry for PnP PowerShell?", Properties.Resources.Confirm))
{
System.IO.File.WriteAllText(telemetryFile, "disallow");
Environment.SetEnvironmentVariable("PNPPOWERSHELL_DISABLETELEMETRY", "true");
if (Connection != null)
{
Connection.ApplicationInsights = null;
}
WriteObject("Telemetry disabled");
}
else
{
var enabled = false;
if (System.IO.File.Exists(telemetryFile))
{
enabled = System.IO.File.ReadAllText(telemetryFile).ToLower() == "allow";
}
WriteObject($"Telemetry setting unchanged: currently {(enabled ? "enabled" : "disabled")}");
}
WriteObject("Telemetry disabled");
}
}
}
22 changes: 3 additions & 19 deletions src/Commands/Base/EnablePowerShellTelemetry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,16 @@
namespace PnP.PowerShell.Commands.Base
{
[Cmdlet(VerbsLifecycle.Enable, "PnPPowerShellTelemetry")]
[Attributes.ApiPermissionsNotRequired(Remarks = "This cmdlet updates a local file, an environment variable and the telemetry setting of the current connection, and performs no request.")]
[Obsolete("Enable-PnPPowerShellTelemetry is deprecated and will be removed in the next release.")]
[Attributes.ApiPermissionsNotRequired(Remarks = "This cmdlet performs no request.")]
public class EnablePowerShellTelemetry : PnPSharePointCmdlet
{
[Parameter(Mandatory = false)]
public SwitchParameter Force;

protected override void ProcessRecord()
{
var userFolder = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
var telemetryFile = System.IO.Path.Combine(userFolder, ".pnppowershelltelemetry");
if (Force || ShouldContinue("Do you want to enable telemetry for PnP PowerShell?", Properties.Resources.Confirm))
{
System.IO.File.WriteAllText(telemetryFile, "allow");
Environment.SetEnvironmentVariable("PNPPOWERSHELL_DISABLETELEMETRY", "false");
Connection?.InitializeTelemetry(Connection.Context, Connection.InitializationType);
WriteObject("Telemetry enabled");
}
else
{
var enabled = false;
if (System.IO.File.Exists(telemetryFile))
{
enabled = System.IO.File.ReadAllText(telemetryFile).ToLower() == "allow" || Environment.GetEnvironmentVariable("PNPPOWERSHELL_DISABLETELEMETRY").Equals("false", StringComparison.InvariantCultureIgnoreCase);
}
WriteObject($"Telemetry setting unchanged: currently {(enabled ? "enabled" : "disabled")}");
}
WriteObject("Telemetry no longer available");
}
}
}
Loading
Loading