8000 Remove the not-working 'run Update-Help from Get-Help when Get-Help runs for the first time' functionality by daxian-dbw · Pull Request #10974 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@daxian-dbw
Copy link
Member
@daxian-dbw daxian-dbw commented Nov 2, 2019

PR Summary

Fix #7452

Background about the setting DisablePromptToUpdateHelp:

In Windows PowerShell, DisablePromptToUpdateHelp is a registry key property set at HKLM\SOFTWARE\Microsoft\PowerShell.
It's not really a setting for user to configure PowerShell, but instead, an implementation detail. It's used by Get-Help to tell if Update-Help has been run yet. On a fresh Windows, DisablePromptToUpdateHelp is not set, so Get-Help running in a admin privilege PowerShell session will prompt user to ask if the user wants to run Update-Help to download help content for all the modules in module path. DisablePromptToUpdateHelp then is set to 1 after the prompt (Update-Help will set it to 1 too), so the code that prompt and run Update-Help in Get-Help is guaranteed to execute only once.

This feature never worked in pwsh, because when moving the registry settings to the powershell.config.json file, UpdatableHelpSystem.ShouldPromptToUpdateHelp() was not updated correctly to keep the previous behavior. However, that was not a bad thing because the previous behavior in Windows PowerShell is not appropriate to pwsh anymore:

  • for powershell.exe, there is only one instance of PowerShell, so the DisablePromptToUpdateHelp key in registry can guarantee the prompt from Get-Help shows up only once.
  • for pwsh.exe, there can be many instances of PowerShell, and they all depend on their own $PSHOME\powershell.config.json, so even if Update-Help has been run, a new instance of pwsh would still show the prompt when you run Get-Help in it. This is not desirable.

Given the fact that:

  1. this feature never worked in pwsh and there has been no complaint about it;
  2. the feature implementation in Windows PowerShell doesn't work for pwsh

I propose to remove this functionality from pwsh, so as to remove the DisablePromptToUpdateHelp setting from powershell.config.json file (it should never be there as an implementation detail).
If we decide to bring back this functionality to pwsh in future, the implementation definitely needs to be re-written.

PR Checklist

@daxian-dbw daxian-dbw changed the title Remove the not-working 'run Update-Help from Get-Help when Get-Help runs for the first time' feature Remove the not-working 'run Update-Help from Get-Help when Get-Help runs for the first time' functionality Nov 4, 2019
@daxian-dbw daxian-dbw requested a review from TravisEz13 November 6, 2019 00:20
@adityapatwardhan adityapatwardhan merged commit 3768be1 into PowerShell:master Nov 7, 2019
@daxian-dbw daxian-dbw deleted the Remove-DisablePromptToUpdateHelp branch November 7, 2019 20:11
@iSazonov iSazonov added the CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log label Nov 8, 2019
@iSazonov iSazonov added this to the 7.0.0-preview.6 milestone Nov 8, 2019
@iSazonov
Copy link
Collaborator
iSazonov commented Nov 8, 2019

Should we set CL-Breaking label? Formally it is a breaking change.

@daxian-dbw
Copy link
Member Author
daxian-dbw commented 8000 Nov 8, 2019

It's not a breaking change to pwsh. The functionality never worked in pwsh.

@iSazonov
Copy link
Collaborator
iSazonov commented Nov 8, 2019

How do we mark the difference from Windows PowerShell?

@daxian-dbw
Copy link
Member Author

I don't think we have such a label ... There are still codes guarded by #if CORECLR and all those places are essentially differences from Windows PowerShell.
@TravisEz13 @adityapatwardhan how do we keep track of the differences between Windows PowerShell and pwsh?

@TravisEz13
Copy link
Member

@daxian-dbw We don't have a method to track those changes

@TravisEz13
Copy link
Member

I agree this is not breaking.

@iSazonov
Copy link
Collaborator
iSazonov commented Nov 9, 2019

My reasoning has always been that when 6.0 version was released, all the differences from Windows PowerShell version was breaking changes (never completely enumerated) and somehow we need to inform users about this.

@TravisEz13
Copy link
Member

Then I think that would just be a doc issue. Breaking changes are to draw attention to breaking change in THAT release. 6.0 being long out of support makes not sense to make a breaking change announcement.

@ghost
Copy link
ghost commented Nov 21, 2019

🎉v7.0.0-preview.6 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Snap and MSIX install of pwsh on Ubuntu does not support Update-Help

4 participants

0