Skip to content
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
21 changes: 0 additions & 21 deletions src/System.Management.Automation/engine/PSConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,27 +198,6 @@ internal void SetConsolePrompting(bool shouldPrompt)
WriteValueToFile<bool>(ConfigScope.AllUsers, "ConsolePrompting", shouldPrompt);
}

/// <summary>
/// Existing Key = HKLM\SOFTWARE\Microsoft\PowerShell
/// Proposed value = Existing default. Probably "0"
///
/// Schema:
/// {
/// "DisablePromptToUpdateHelp" : bool
/// }
/// </summary>
/// <returns>Boolean indicating whether Update-Help should prompt. If the value cannot be read, it defaults to false.</returns>
internal bool GetDisablePromptToUpdateHelp()
{
return ReadValueFromFile<bool>(ConfigScope.AllUsers, "DisablePromptToUpdateHelp");
}

internal void SetDisablePromptToUpdateHelp(bool prompt)
{
WriteValueToFile<bool>(ConfigScope.AllUsers, "DisablePromptToUpdateHelp", prompt);
}

/// <summary>
/// Get the names of experimental features enabled in the config file.
/// </summary>
internal string[] GetExperimentalFeatures()
Expand Down
22 changes: 0 additions & 22 deletions src/System.Management.Automation/help/HelpCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,19 +246,6 @@ public SwitchParameter ShowWindow
protected override void BeginProcessing()
{
_timer.Start();

if (!Online.IsPresent && UpdatableHelpSystem.ShouldPromptToUpdateHelp() && HostUtilities.IsProcessInteractive(MyInvocation) && HasInternetConnection())
{
if (ShouldContinue(HelpDisplayStrings.UpdateHelpPromptBody, HelpDisplayStrings.UpdateHelpPromptTitle))
{
System.Management.Automation.PowerShell.Create(RunspaceMode.CurrentRunspace).AddCommand("Update-Help").Invoke();
#if LEGACYTELEMETRY
_updatedHelp = true;
#endif
}

UpdatableHelpSystem.SetDisablePromptToUpdateHelp();
}
}

/// <summary>
Expand Down Expand Up @@ -716,15 +703,6 @@ private void HelpSystem_OnComplete()
WriteProgress(record);
}

/// <summary>
/// Checks if we can connect to the internet.
/// </summary>
/// <returns></returns>
private bool HasInternetConnection()
{
return true; // TODO:CORECLR wininet.dll is not present on NanoServer
}

#region Helper methods for verification of parameters against NoLanguage mode

internal static void VerifyParameterForbiddenInRemoteRunspace(Cmdlet cmdlet, string parameterName)
Expand Down
46 changes: 0 additions & 46 deletions src/System.Management.Automation/help/UpdatableHelpSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1500,52 +1500,6 @@ internal string GetDefaultSourcePath()
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
Expand Down
3 changes: 0 additions & 3 deletions src/System.Management.Automation/help/UpdateHelpCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,6 @@ public SwitchParameter Recurse
/// </summary>
protected override void BeginProcessing()
{
// Disable Get-Help prompt
UpdatableHelpSystem.SetDisablePromptToUpdateHelp();

if (_path == null)
{
// Pull default source path from GP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,12 +449,6 @@ To update help again, add the Force parameter to your command.</value>
<data name="RootElementMustBeHelpItems" xml:space="preserve">
<value>The root level element of the help content must be "helpItems".</value>
</data>
<data name="UpdateHelpPromptBody" xml:space="preserve">
<value>The Update-Help cmdlet downloads the most current Help files for PowerShell modules, and installs them on your computer. For more information about the Update-Help cmdlet, see https://go.microsoft.com/fwlink/?LinkId=210614.</value>
</data>
<data name="UpdateHelpPromptTitle" xml:space="preserve">
<value>Do you want to run Update-Help?</value>
</data>
<data name="SaveProgressActivityForModule" xml:space="preserve">
<value>Saving Help for module {0}</value>
</data>
Expand Down