Remove the not-working 'run Update-Help from Get-Help when Get-Help runs for the first time' feature (#10974)

This commit is contained in:
Dongbo Wang authored and Aditya Patwardhan committed 2019-11-07 11:54:22 -08:00
1 parent 9851b07b1d
commit 3768be1b21
5 files changed
-98

No files matched your search

@@ -1500,52 +1500,6 @@ namespace System.Management.Automation.Help
return string.IsNullOrEmpty(defaultSourcePath) ? null : defaultSourcePath;
}
/// <summary>
/// Sets the DisablePromptToUpdatableHelp regkey.
/// </summary>
internal static void SetDisablePromptToUpdateHelp()
{
try
{
PowerShellConfig.Instance.SetDisablePromptToUpdateHelp(true);
}
catch (UnauthorizedAccessException)
{
// Ignore AccessDenied related exceptions
}
catch (SecurityException)
{
// Ignore AccessDenied related exceptions
}
}
/// <summary>
/// Checks if it is necessary to prompt to update help.
/// </summary>
/// <returns></returns>
internal static bool ShouldPromptToUpdateHelp()
{
#if UNIX
// TODO: This workaround needs to be removed once updatable help
// works on Linux.
return false;
#else
try
{
if (!Utils.IsAdministrator())
{
return false;
}
return PowerShellConfig.Instance.GetDisablePromptToUpdateHelp();
}
catch (SecurityException)
{
return false;
}
#endif
}
#endregion
#region Events