Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
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
3 changes: 0 additions & 3 deletions 3 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ dotnet-uninstall-debian-packages.sh
*.nupkg
*.AppImage

# ignore the telemetry semaphore file
DELETE_ME_TO_DISABLE_CONSOLEHOST_TELEMETRY

# default location for produced nuget packages
/nuget-artifacts

Expand Down
4 changes: 3 additions & 1 deletion 4 .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ after_success:

# travis-ci will quit using the cache if an enviroment variable changes
env:
- CACHE_VERSION=netcoreapp.2.0.6-sdk.2.1.4
global:
- CACHE_VERSION=netcoreapp.2.0.6-sdk.2.1.4
- POWERSHELL_TELEMETRY_OPTOUT=1

# timeout uploading cache after 6 minutes (360 seconds)
cache:
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion 2 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ License: By requesting and using the Container OS Image for Windows containers,
### Telemetry

By default, PowerShell collects the OS description and the version of PowerShell (equivalent to `$PSVersionTable.OS` and `$PSVersionTable.GitCommitId`) using [Application Insights](https://azure.microsoft.com/en-us/services/application-insights/).
To opt-out of sending telemetry, delete the file `DELETE_ME_TO_DISABLE_CONSOLEHOST_TELEMETRY` before starting PowerShell from the installed location.
To opt-out of sending telemetry, create an environment variable called `POWERSHELL_TELEMETRY_OPTOUT` set to a value of `1` before starting PowerShell from the installed location.
The telemetry we collect fall under the [Microsoft Privacy Statement](https://privacy.microsoft.com/en-us/privacystatement/).

## Governance
Expand Down
3 changes: 3 additions & 0 deletions 3 appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ cache:
nuget:
project_feed: true

environment:
POWERSHELL_TELEMETRY_OPTOUT: 1

install:
- git submodule update --init
- ps: Import-Module .\tools\Appveyor.psm1
Expand Down
4 changes: 0 additions & 4 deletions 4 assets/files.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,6 @@
<Component Id="cmp06E8C21C125E29603C631488D5EBC1CA" Guid="{41159F5F-FED9-4C2E-8671-57C9CD46A5CF}">
<File Id="fil33FE96846639CB621C7B04A56ED64E24" KeyPath="yes" Source="$(env.ProductSourcePath)\hostfxr.dll" />
</Component>
<Component Id="cmp15A47D494DF254A3900DDEF6D2CDFBA2" Guid="{36E0C8A2-F015-400B-83B1-55B72A856270}">
<File Id="fil9347D9464088FAEC056F05E3CD93CFFD" KeyPath="yes" Source="$(env.ProductSourcePath)\DELETE_ME_TO_DISABLE_CONSOLEHOST_TELEMETRY" />
</Component>
<Component Id="cmp18FD8ABAE1B131CE3834F0E2BB07E5B8" Guid="{3F9A0E71-7848-49E3-BD35-D5DD1C838B9E}">
<File Id="fil4107C2714D75DB3C2AFC183E124E17DB" KeyPath="yes" Source="$(env.ProductSourcePath)\Microsoft.Management.Infrastructure.Native.Unmanaged.dll" />
</Component>
Expand Down Expand Up @@ -1890,7 +1887,6 @@
<ComponentRef Id="cmp28A6204649AC15DA0210CE3067308BDE" />
<ComponentRef Id="cmpA4C6AF97A7B02D8D55E1E09AB7F74558" />
<ComponentRef Id="cmp06E8C21C125E29603C631488D5EBC1CA" />
<ComponentRef Id="cmp15A47D494DF254A3900DDEF6D2CDFBA2" />
<ComponentRef Id="cmp18FD8ABAE1B131CE3834F0E2BB07E5B8" />
<ComponentRef Id="cmp8552B147D2AAFD164533C72368BFB61C" />
<ComponentRef Id="cmp33AA41435A9FDD75B7D5FA6869C6F441" />
Expand Down
10 changes: 6 additions & 4 deletions 10 build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,6 @@ function Start-PSBuild {
}
}

# create the telemetry flag file
$null = new-item -force -type file "$psscriptroot/DELETE_ME_TO_DISABLE_CONSOLEHOST_TELEMETRY"

# Add .NET CLI tools to PATH
Find-Dotnet

Expand Down Expand Up @@ -1054,7 +1051,9 @@ Restore the module to '$Pester' by running:
Publish-PSTestTools | ForEach-Object {Write-Host $_}

# All concatenated commands/arguments are suffixed with the delimiter (space)
$command = ""

# Disable telemetry for all startups of pwsh in tests
$command = "`$env:POWERSHELL_TELEMETRY_OPTOUT = 1;"
if ($Terse)
{
$command += "`$ProgressPreference = 'silentlyContinue'; "
Expand Down Expand Up @@ -1155,6 +1154,8 @@ Restore the module to '$Pester' by running:
# To ensure proper testing, the module path must not be inherited by the spawned process
try {
$originalModulePath = $env:PSModulePath
$originalTelemetry = $env:POWERSHELL_TELEMETRY_OPTOUT
$env:POWERSHELL_TELEMETRY_OPTOUT = 1
if ($Unelevate)
{
Start-UnelevatedProcess -process $powershell -arguments @('-noprofile', '-c', $Command)
Expand Down Expand Up @@ -1231,6 +1232,7 @@ Restore the module to '$Pester' by running:
}
} finally {
$env:PSModulePath = $originalModulePath
$env:POWERSHELL_TELEMETRY_OPTOUT = $originalTelemetry
if ($Unelevate)
{
Remove-Item $outputBufferFilePath
Expand Down
14 changes: 2 additions & 12 deletions 14 src/Microsoft.PowerShell.ConsoleHost/host/msh/Telemetry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,9 @@ namespace Microsoft.PowerShell
/// </summary>
internal static class ApplicationInsightsTelemetry
{
// The semaphore file which indicates whether telemetry should be sent
// This is temporary code waiting on the acceptance and implementation of the configuration spec
// The name of the file by when present in $PSHOME will enable telemetry.
// If this file is not present, no telemetry will be sent.
private const string TelemetrySemaphoreFilename = "DELETE_ME_TO_DISABLE_CONSOLEHOST_TELEMETRY";
// If this env var is true, yes, or 1, telemetry will NOT be sent.
private const string TelemetryOptoutEnvVar = "POWERSHELL_TELEMETRY_OPTOUT";

// The path to the semaphore file which enables telemetry
private static string TelemetrySemaphoreFilePath = Path.Combine(
Utils.DefaultPowerShellAppBase,
TelemetrySemaphoreFilename);

// Telemetry client to be reused when we start sending more telemetry
private static TelemetryClient _telemetryClient = null;

Expand Down Expand Up @@ -75,8 +66,7 @@ private static void SendTelemetry(string eventName, Dictionary<string,string>pay
{
try
{
// if the semaphore file exists, try to send telemetry
var enabled = Utils.NativeFileExists(TelemetrySemaphoreFilePath) && !GetEnvironmentVariableAsBool(TelemetryOptoutEnvVar, false);
var enabled = !GetEnvironmentVariableAsBool(name : TelemetryOptoutEnvVar, defaultValue : false);

if (!enabled)
{
Expand Down
2 changes: 1 addition & 1 deletion 2 src/powershell-unix/powershell-unix.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="..\..\license_thirdparty_proprietary.txt;..\..\DELETE_ME_TO_DISABLE_CONSOLEHOST_TELEMETRY">
<Content Include="..\..\license_thirdparty_proprietary.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
Expand Down
2 changes: 1 addition & 1 deletion 2 src/powershell-win-core/powershell-win-core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="..\..\license_thirdparty_proprietary.txt;..\..\DELETE_ME_TO_DISABLE_CONSOLEHOST_TELEMETRY;..\powershell-native\Install-PowerShellRemoting.ps1;..\PowerShell.Core.Instrumentation\PowerShell.Core.Instrumentation.man;..\PowerShell.Core.Instrumentation\RegisterManifest.ps1">
<Content Include="..\..\license_thirdparty_proprietary.txt;..\powershell-native\Install-PowerShellRemoting.ps1;..\PowerShell.Core.Instrumentation\PowerShell.Core.Instrumentation.man;..\PowerShell.Core.Instrumentation\RegisterManifest.ps1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
Expand Down
6 changes: 0 additions & 6 deletions 6 tools/appveyor.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -347,12 +347,6 @@ function Invoke-AppVeyorTest
Write-Host -Foreground Green 'Running all CoreCLR tests..'
}

# Remove telemetry semaphore file in CI
$telemetrySemaphoreFilepath = Join-Path $env:CoreOutput DELETE_ME_TO_DISABLE_CONSOLEHOST_TELEMETRY
if ( Test-Path "${telemetrySemaphoreFilepath}" ) {
Remove-Item -Force ${telemetrySemaphoreFilepath}
}

Start-PSPester -Terse -bindir $env:CoreOutput -outputFile $testResultsNonAdminFile -Unelevate -Tag @() -ExcludeTag ($ExcludeTag + @('RequireAdminOnWindows'))
Write-Host -Foreground Green 'Upload CoreCLR Non-Admin test results'
Update-AppVeyorTestResults -resultsFile $testResultsNonAdminFile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ make -j
cd ../..
dotnet restore $dotnetArguments

# Add telemetry file
touch DELETE_ME_TO_DISABLE_CONSOLEHOST_TELEMETRY

# run ResGen
cd src/ResGen
dotnet run
Expand Down
6 changes: 0 additions & 6 deletions 6 tools/travis.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,6 @@ elseif($Stage -eq 'Build')
$pesterParam['IncludeFailingTest'] = $true
}

# Remove telemetry semaphore file in CI
$telemetrySemaphoreFilepath = Join-Path $output DELETE_ME_TO_DISABLE_CONSOLEHOST_TELEMETRY
if ( Test-Path "${telemetrySemaphoreFilepath}" ) {
Remove-Item -force ${telemetrySemaphoreFilepath}
}

# Running tests which do not require sudo.
$pesterPassThruNoSudoObject = Start-PSPester @pesterParam

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.