mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-15 14:20:03 +00:00
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:
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
|
||||
|
||||
Reference in new issue
Block a user