-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PowerShell ignoring telemetry opt-out options, tries to call home regularly #10005
Comments
@inoperable Could you create a simple dotnet core application and try to catch the commenctions? It helps us understand where root of the issue is - in .Net Core runtime or in PowerShell. @TravisEz13 Perhaps you could help with the issue? |
The IP addresses (13.69.65.22 and 40.114.241.141) is in the list https://docs.microsoft.com/bs-latn-ba/azure/azure-monitor/app/ip-addresses but both PowerShell and .Net Core can use applicationinsights. |
This is all fine and dandy, but this shouldn't be the case - this makes the whole telemetry optout option just a superstitious move. How do you differentate between telemetry and appinsights? How does it relate to the POWERSHELL_TELEMETRY_OPTOUT. I thought the whole point of the option is to make any such connections impossible - or am I missing something. |
Thank you for your answer - I dodn't have any dotnet sdk installed (yet). I simply add those OPTOUT options by default on every test machine to reduce noise. It is clearly the AppInsights silent optin - I went through your IP list and crossreferenced some of the ip's with my logs. Might also I just missed some smallprint somewhere but I don't remember any AppInsights part during installation. Seriously, the only consistant thing is the missuse of the word telemetry across all MS products where one should write user data collection or spyware in short. So what's next APPINSIGHTS_TELEMETRY_OPTOUT? |
Microsoft.ApplicationInsights is an API for telemetry. PowerShell and Core uses the API. POWERSHELL_TELEMETRY_OPTOUT=1 disables sending a telemetry in PowerShell Core. |
It looks like you did not used the wrong environment variable name. See #10005 (comment) |
I don't understand entirely what you mean - as you can see in the screenshots above, I did used the right variable name, I actually used it twice. |
Perhaps something other than PowerShell is sending this telemetry. |
As you can see in the screenshots I posted - it's definitly pwsh.exe process that is initializing the connection. It's not some unknown process, nor can there be any other process - I'm quite sure about it. UPDATE: I just run the same on a clean VM installed Windows 10 / Powershell Core installation and with the variables set BEFORE. This aside, does this mean that after first-run it Powershell ignore those variable afterwards? The issue is not solved. I can repeat that behaviour. It seems that Powershell does indeed ignore thoses variables. |
Try setting
|
BTW the nice thing about open source is you can look yourself to see where the telemetry is being sent: PowerShell/src/Microsoft.PowerShell.ConsoleHost/host/msh/Telemetry.cs Lines 67 to 89 in bd6fdae
The logic is a bit odd. I wish the variable on line 71 was called |
C:\Users\Administrator>pwsh
@rkeithhill Keith, thank you for pointing out the relevant function, can patch that function to be sure but still It does not make any sense - you can see that all of those variables are set in my first post - by simply running the snippet you can verify that they are set properly in Could it have something to do with the fact of using the built-in Administrator account instead of the usual one? I would happily patch it and be over it but the build process is - complicated - at least. Like written before,, see my first post- I've set 8 different variables in total... and it still does send telemetry - that's why I posted here in the first place. Double checked once again. DOTNET_... shouldn't even be there since that variable is not in function you've mentioned but I've set all kind of combinations to be sure (the documentation is not really clear about it and the whole discussion here proves it) |
RE It is possible it is another MS shared library (or PowerShell module) that is sending the telemetry. PowerShell does run in a conhost.exe instance. Do you see these connections if you fire up cmd.exe? That would rule out conhost.exe (since cmd.exe also uses it). There is active development going on with conhost right now. Maybe they're looking for telemetry on usage? |
@rkeithhill I can't find any requests from |
PowerShell Core sends the telemetry only at startup. So it is not POwerSHell issue. Root cause could be in ApplicationInsights or in .Net Core, or another process. |
The variable MUST be set in the environment BEFORE the process is start as it read at startup. Again, Please use the issue template and provide a complete repro. I really don't understand what you are trying to say the problem is here. You asked as question. The question has been answered and this issue is resolved. If you would like us to treat this like an issue, fill out the complete issue template with the full steps required to reproduce the issue. But, if I understand you correctly, you have a feature request, which is to recognize that you don't want telemetry to be sent after the process is started. If that is the case, please use the feature request template. |
This issue has been marked as answered and has not had any activity for 1 day. It has been closed for housekeeping purposes. |
I've set a number of OPT-OUT (optout? OPTOUT?) options, since i'm not sure which method is the proper one - your documentation is saying different things at different locations, and the installer, the installer says otherwise, i'm not wisers. Am I suppose to set the OPT-OUT in the user 'scope'? If the OPT-OUT var is set in the 'Machine' scope - does pwsh.exe ignores it or is the Machine Scope super-seeding User scope? Docs don't mention anything at all.
Despite setting all the variants of the opt-out env variables by running snippet in pwsh 6.2.1 and 7.0.0.p1 (built-in Administrator account, Win10 Pro build 10.0.18922.1000 ) I still got repeated connection request to MS servers which I did not approved nor was I asked about it (for users who don't filter traffic they won't even know about it)
That being said, why is it trying to connect randomly for god-knows-what every few minutes? Behaviour happens on launch / exit of pwsh.exe session - 3 times during the write of this text. Privacy being the marketing word lately in MS, but no one seems to clarify what actually is being send to where and for what - just don't drag me into the discussion about the needs of telemetry because I dont need it.
[System.Environment]::SetEnvironmentVariable('POWERSHELL_CLI_TELEMETRY_OPTOUT',1,'User');[System.Environment]::SetEnvironmentVariable('POWERSHELL_TELEMETRY_OPTOUT',1,'User');[System.Environment]::SetEnvironmentVariable('DOTNET_CLI_TELEMETRY_OPTOUT',1,'User');[System.Environment]::SetEnvironmentVariable('DOTNET_TELEMETRY_OPTOUT',1,'User');[System.Environment]::SetEnvironmentVariable('POWERSHELL_CLI_TELEMETRY_OPTOUT',1,'Machine');[System.Environment]::SetEnvironmentVariable('POWERSHELL_TELEMETRY_OPTOUT',1,'Machine');[System.Environment]::SetEnvironmentVariable('DOTNET_CLI_TELEMETRY_OPTOUT',1,'Machine');[System.Environment]::SetEnvironmentVariable('DOTNET_TELEMETRY_OPTOUT',1,'Machine')
The text was updated successfully, but these errors were encountered: