From d717458e7d98cef9dc078c53b3ca9a4d42ceba64 Mon Sep 17 00:00:00 2001 From: Francisco Gamino Date: Wed, 12 Oct 2016 12:16:32 -0700 Subject: [PATCH] Fixing get-help -online for .NET Core on Desktop. (#2174) In PS Core on windows, we try to locate the default web browser and use it for online help. If we cannot find the default web browser (in NanoServer/IoT), we error out. --- .../engine/Utils.cs | 1 + .../help/HelpCommands.cs | 74 +++++- .../engine/HelpSystem.OnlineHelp.Tests.ps1 | 94 +++++++ .../engine/testdata/HelpURI/V2Cmdlets.csv | 249 ++++++++++++++++++ .../engine/testdata/HelpURI/V3Cmdlets.csv | 92 +++++++ 5 files changed, 507 insertions(+), 3 deletions(-) create mode 100644 test/powershell/engine/HelpSystem.OnlineHelp.Tests.ps1 create mode 100644 test/powershell/engine/testdata/HelpURI/V2Cmdlets.csv create mode 100644 test/powershell/engine/testdata/HelpURI/V3Cmdlets.csv diff --git a/src/System.Management.Automation/engine/Utils.cs b/src/System.Management.Automation/engine/Utils.cs index ec28855e14..70d3ac4a94 100644 --- a/src/System.Management.Automation/engine/Utils.cs +++ b/src/System.Management.Automation/engine/Utils.cs @@ -1564,6 +1564,7 @@ namespace System.Management.Automation.Internal internal static bool ForceScriptBlockLogging; internal static bool UseDebugAmsiImplementation; internal static bool BypassAppLockerPolicyCaching; + internal static bool BypassOnlineHelpRetrieval; // It's useful to test that we don't depend on the ScriptBlock and AST objects and can use a re-parsed version. internal static bool IgnoreScriptBlockCache; diff --git a/src/System.Management.Automation/help/HelpCommands.cs b/src/System.Management.Automation/help/HelpCommands.cs index 095e3c3f14..36550fd5f5 100644 --- a/src/System.Management.Automation/help/HelpCommands.cs +++ b/src/System.Management.Automation/help/HelpCommands.cs @@ -14,6 +14,10 @@ using System.Globalization; using System.Management.Automation.Internal; using System.Management.Automation.Help; using System.Runtime.InteropServices; +using System.IO; +#if !UNIX +using Microsoft.Win32; +#endif namespace Microsoft.PowerShell.Commands { @@ -615,18 +619,39 @@ namespace Microsoft.PowerShell.Commands "https"); } + // we use this test hook is to avoid actually calling out to another process + if (InternalTestHooks.BypassOnlineHelpRetrieval) + { + this.WriteObject(string.Format(CultureInfo.InvariantCulture, HelpDisplayStrings.OnlineHelpUri, uriToLaunch.OriginalString)); + return; + } + Exception exception = null; + bool wrapCaughtException = true; try { this.WriteVerbose(string.Format(CultureInfo.InvariantCulture, HelpDisplayStrings.OnlineHelpUri, uriToLaunch.OriginalString)); System.Diagnostics.Process browserProcess = new System.Diagnostics.Process(); - #if UNIX browserProcess.StartInfo.FileName = Platform.IsLinux ? "xdg-open" : /* OS X */ "open"; browserProcess.StartInfo.Arguments = uriToLaunch.OriginalString; browserProcess.Start(); #elif CORECLR - throw new PlatformNotSupportedException(); + // On FullCLR, ProcessStartInfo.UseShellExecute is true by default. This means that the shell will be used when starting the process. + // On CoreCLR, UseShellExecute is not supported. To work around this, we check if there is a default browser in the system. + // If there is, we lunch it to open the HelpURI. If there isn't, we error out. + string webBrowserPath = GetDefaultWebBrowser(); + if (webBrowserPath == null) + { + wrapCaughtException = false; + exception = PSTraceSource.NewInvalidOperationException(HelpErrors.CannotLaunchURI, uriToLaunch.OriginalString); + } + else + { + browserProcess.StartInfo = new ProcessStartInfo(webBrowserPath); + browserProcess.StartInfo.Arguments = "\"" + uriToLaunch.OriginalString + "\""; + browserProcess.Start(); + } #else browserProcess.StartInfo.FileName = uriToLaunch.OriginalString; browserProcess.Start(); @@ -643,10 +668,53 @@ namespace Microsoft.PowerShell.Commands if (null != exception) { - throw PSTraceSource.NewInvalidOperationException(exception, HelpErrors.CannotLaunchURI, uriToLaunch.OriginalString); + if (wrapCaughtException) + throw PSTraceSource.NewInvalidOperationException(exception, HelpErrors.CannotLaunchURI, uriToLaunch.OriginalString); + else + throw exception; } } +#if !UNIX + /// + /// Gets the path to the default browser by querying the Windows registry. + /// + /// + private string GetDefaultWebBrowser() + { + // Check if there is a default browser in the system. + const string httpRegkey = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice"; + object progId = Registry.GetValue(httpRegkey, "ProgId", null); + if (progId != null) + { + // Query the registry to find the web browser path. + using (RegistryKey browserRegKey = Registry.ClassesRoot.OpenSubKey(progId + "\\shell\\open\\command", false)) + { + string browserPath = browserRegKey?.GetValue(null)?.ToString().Replace(/* remove the quotes */ "\"", ""); + if (!string.IsNullOrEmpty(browserPath)) + { + const string exeExtension = ".exe"; + if (!browserPath.EndsWith(exeExtension, StringComparison.OrdinalIgnoreCase)) + { + // Remove any extra chars in the path after ".exe". + int extIndex = browserPath.LastIndexOf(exeExtension, StringComparison.OrdinalIgnoreCase); + browserPath = extIndex > 0 ? browserPath.Substring(0, extIndex + exeExtension.Length) : string.Empty; + } + + // Make sure the path to the default browser exists. + if (File.Exists(browserPath)) + { + return browserPath; + } + } + } + } + + // By default, return null. + return null; + } +#endif + #endregion private void HelpSystem_OnProgress(object sender, HelpProgressInfo arg) diff --git a/test/powershell/engine/HelpSystem.OnlineHelp.Tests.ps1 b/test/powershell/engine/HelpSystem.OnlineHelp.Tests.ps1 new file mode 100644 index 0000000000..11c532bacd --- /dev/null +++ b/test/powershell/engine/HelpSystem.OnlineHelp.Tests.ps1 @@ -0,0 +1,94 @@ +Describe 'Online help tests for PowerShell Core Cmdlets' -Tags "CI" { + + # The csv files (V2Cmdlets.csv and V3Cmdlets.csv) contain a list of cmdlets and expected HelpURIs. + # The HelpURI is part of the cmdlet metadata, and when the user runs 'get-help -online' + # the browser navigates to the address in the HelpURI. However, if a help file is present, the HelpURI + # on the file take precedence over the one in the cmdlet metadata. Therefore, the help content + # in the box needs to be deleted before running the tests, because otherwise, the HelpURI + # (when calling get-help -online) might not matched the one in the csv file. + + # Currently update-help does not work on Linux (see https://github.com/PowerShell/PowerShell/issues/951), + # so if the help content is deleted, we do not have a way to install it back, and any subsequent + # 'get-help' tests which depend on the help content will fail. Until this update-help issue is fixed, + # we need to skip these tests on Linux and OSX. + + $skipTest = ([System.Management.Automation.Platform]::IsLinux -or [System.Management.Automation.Platform]::IsOSX) + + BeforeAll { + + # There is a bug in Linux in which a 'Boolean value defined inside Describe block cannot be evaluated properly + # in if statement inside BeforeAll block on Linux' Becuase of this, I need to define the bool value again inside the block. + # See https://github.com/PowerShell/PowerShell/issues/2445 + # + $skipTest = ([System.Management.Automation.Platform]::IsLinux -or [System.Management.Automation.Platform]::IsOSX) + + if (-not $skipTest) + { + # Enable the test hook + [system.management.automation.internal.internaltesthooks]::SetTestHook('BypassOnlineHelpRetrieval', $true) + + # Remove the help content + Write-Verbose "Deleting help content for get-help -online tests" -Verbose + $path = Join-Path $PSHOME (Get-UICulture).Name + Get-ChildItem "$path\*dll-help.xml" -Recurse -ErrorAction SilentlyContinue | Remove-Item -Force -ErrorAction SilentlyContinue + } + } + + AfterAll { + if (-not $skipTest) + { + # Disable the test hook + [system.management.automation.internal.internaltesthooks]::SetTestHook('BypassOnlineHelpRetrieval', $false) + } + } + + foreach ($filePath in @("$PSScriptRoot\testdata\HelpURI\V2Cmdlets.csv", "$PSScriptRoot\testdata\HelpURI\V3Cmdlets.csv")) + { + $cmdletList = Import-Csv $filePath -ea Stop + + foreach ($cmdlet in $cmdletList) + { + # If the cmdlet is not preset in CoreCLR, skip it. + if (Get-Command $cmdlet.TopicTitle -ea SilentlyContinue) + { + # TopicTitle - is the cmdlet name in the csv file + # HelpURI - is the expected help URI in the csv file + + It "Validate 'get-help $($cmdlet.TopicTitle) -Online'" -skip:$skipTest { + $actualURI = Get-Help $cmdlet.TopicTitle -Online + $actualURI = $actualURI.Replace("Help URI: ","") + $actualURI | Should Be $cmdlet.HelpURI + } + } + } + } +} + +Describe 'Get-Help -Online opens the default web browser and navigates to the cmdlet help content' -Tags "Feature" { + + $skipTest = [System.Management.Automation.Platform]::IsIoT -or + [System.Management.Automation.Platform]::IsNanoServer + + It "Get-Help get-process -online" -skip:$skipTest { + + { Get-Help get-process -online } | Should Not Throw + } +} + +Describe 'Get-Help -Online is not supported on Nano Server and IoT' -Tags "CI" { + + $skipTest = -not ([System.Management.Automation.Platform]::IsIoT -or [System.Management.Automation.Platform]::IsNanoServer) + + It "Get-help -online throws InvalidOperation." -skip:$skipTest { + + try + { + Get-Help Get-Help -Online + throw "Execution should not have succeeded" + } + catch + { + $_.FullyQualifiedErrorId | Should Be "InvalidOperation,Microsoft.PowerShell.Commands.GetHelpCommand" + } + } +} diff --git a/test/powershell/engine/testdata/HelpURI/V2Cmdlets.csv b/test/powershell/engine/testdata/HelpURI/V2Cmdlets.csv new file mode 100644 index 0000000000..21ad09d719 --- /dev/null +++ b/test/powershell/engine/testdata/HelpURI/V2Cmdlets.csv @@ -0,0 +1,249 @@ +TopicTitle,HelpURI +Add-Computer,https://go.microsoft.com/fwlink/?LinkID=135194 +Add-Content,https://go.microsoft.com/fwlink/?LinkID=113278 +Add-History,https://go.microsoft.com/fwlink/?LinkID=113279 +Add-Member,https://go.microsoft.com/fwlink/?LinkID=113280 +Add-PsSnapin,https://go.microsoft.com/fwlink/?LinkID=113281 +Add-Type,https://go.microsoft.com/fwlink/?LinkID=135195 +Checkpoint-Computer,https://go.microsoft.com/fwlink/?LinkID=135197 +Clear-Content,https://go.microsoft.com/fwlink/?LinkID=113282 +Clear-EventLog,https://go.microsoft.com/fwlink/?LinkID=135198 +Clear-History,https://go.microsoft.com/fwlink/?LinkID=135199 +Clear-Item,https://go.microsoft.com/fwlink/?LinkID=113283 +Clear-ItemProperty,https://go.microsoft.com/fwlink/?LinkID=113284 +Clear-Variable,https://go.microsoft.com/fwlink/?LinkID=113285 +Compare-Object,https://go.microsoft.com/fwlink/?LinkID=113286 +Complete-Transaction,https://go.microsoft.com/fwlink/?LinkID=135200 +Connect-WSMan,https://go.microsoft.com/fwlink/?LinkID=141437 +ConvertFrom-Csv,https://go.microsoft.com/fwlink/?LinkID=135201 +ConvertFrom-SecureString,https://go.microsoft.com/fwlink/?LinkID=113287 +ConvertFrom-StringData,https://go.microsoft.com/fwlink/?LinkID=113288 +Convert-Path,https://go.microsoft.com/fwlink/?LinkID=113289 +ConvertTo-Csv,https://go.microsoft.com/fwlink/?LinkID=135203 +ConvertTo-Html,https://go.microsoft.com/fwlink/?LinkID=113290 +ConvertTo-SecureString,https://go.microsoft.com/fwlink/?LinkID=113291 +ConvertTo-XML,https://go.microsoft.com/fwlink/?LinkID=135204 +Copy-Item,https://go.microsoft.com/fwlink/?LinkID=113292 +Copy-ItemProperty,https://go.microsoft.com/fwlink/?LinkID=113293 +Debug-Process,https://go.microsoft.com/fwlink/?LinkID=135206 +Disable-ComputerRestore,https://go.microsoft.com/fwlink/?LinkID=135207 +Disable-PSBreakpoint,https://go.microsoft.com/fwlink/?LinkID=113294 +Disable-PSRemoting,https://go.microsoft.com/fwlink/?LinkID=144298 +Disable-PSSessionConfiguration,https://go.microsoft.com/fwlink/?LinkID=144299 +Disable-WSManCredSSP,https://go.microsoft.com/fwlink/?LinkID=141438 +Disconnect-WSMan,https://go.microsoft.com/fwlink/?LinkID=141439 +Enable-ComputerRestore,https://go.microsoft.com/fwlink/?LinkID=135209 +Enable-PSBreakpoint,https://go.microsoft.com/fwlink/?LinkID=113295 +Enable-PSRemoting,https://go.microsoft.com/fwlink/?LinkID=144300 +Enable-PSSessionConfiguration,https://go.microsoft.com/fwlink/?LinkID=144301 +Enable-WSManCredSSP,https://go.microsoft.com/fwlink/?LinkID=141442 +Enter-PsSession,https://go.microsoft.com/fwlink/?LinkID=135210 +Exit-PsSession,https://go.microsoft.com/fwlink/?LinkID=135212 +Export-Alias,https://go.microsoft.com/fwlink/?LinkID=113296 +Export-Clixml,https://go.microsoft.com/fwlink/?LinkID=113297 +Export-Console,https://go.microsoft.com/fwlink/?LinkID=113298 +Export-Counter,https://go.microsoft.com/fwlink/?LinkID=138337 +Export-Csv,https://go.microsoft.com/fwlink/?LinkID=113299 +Export-FormatData,https://go.microsoft.com/fwlink/?LinkID=144302 +Export-ModuleMember,https://go.microsoft.com/fwlink/?LinkID=141551 +Export-PsSession,https://go.microsoft.com/fwlink/?LinkID=135213 +ForEach-Object,https://go.microsoft.com/fwlink/?LinkID=113300 +Format-Custom,https://go.microsoft.com/fwlink/?LinkID=113301 +Format-List,https://go.microsoft.com/fwlink/?LinkID=113302 +Format-Table,https://go.microsoft.com/fwlink/?LinkID=113303 +Format-Wide,https://go.microsoft.com/fwlink/?LinkID=113304 +Get-Acl,https://go.microsoft.com/fwlink/?LinkID=113305 +Get-Alias,https://go.microsoft.com/fwlink/?LinkID=113306 +Get-AuthenticodeSignature,https://go.microsoft.com/fwlink/?LinkID=113307 +Get-ChildItem,https://go.microsoft.com/fwlink/?LinkID=113308 +Get-Command,https://go.microsoft.com/fwlink/?LinkID=113309 +Get-ComputerRestorePoint,https://go.microsoft.com/fwlink/?LinkID=135215 +Get-Content,https://go.microsoft.com/fwlink/?LinkID=113310 +Get-Counter,https://go.microsoft.com/fwlink/?LinkID=138335 +Get-Credential,https://go.microsoft.com/fwlink/?LinkID=113311 +Get-Culture,https://go.microsoft.com/fwlink/?LinkID=113312 +Get-Date,https://go.microsoft.com/fwlink/?LinkID=113313 +Get-Event,https://go.microsoft.com/fwlink/?LinkID=113453 +Get-EventLog,https://go.microsoft.com/fwlink/?LinkID=113314 +Get-EventSubscriber,https://go.microsoft.com/fwlink/?LinkID=135155 +Get-ExecutionPolicy,https://go.microsoft.com/fwlink/?LinkID=113315 +Get-FormatData,https://go.microsoft.com/fwlink/?LinkID=144303 +Get-Help,https://go.microsoft.com/fwlink/?LinkID=113316 +Get-History,https://go.microsoft.com/fwlink/?LinkID=113317 +Get-Host,https://go.microsoft.com/fwlink/?LinkID=113318 +Get-Hotfix,https://go.microsoft.com/fwlink/?LinkID=135217 +Get-Item,https://go.microsoft.com/fwlink/?LinkID=113319 +Get-ItemProperty,https://go.microsoft.com/fwlink/?LinkID=113320 +Get-Job,https://go.microsoft.com/fwlink/?LinkID=113328 +Get-Location,https://go.microsoft.com/fwlink/?LinkID=113321 +Get-Member,https://go.microsoft.com/fwlink/?LinkID=113322 +Get-Module,https://go.microsoft.com/fwlink/?LinkID=141552 +Get-PfxCertificate,https://go.microsoft.com/fwlink/?LinkID=113323 +Get-Process,https://go.microsoft.com/fwlink/?LinkID=113324 +Get-PSBreakpoint,https://go.microsoft.com/fwlink/?LinkID=113325 +Get-PSCallStack,https://go.microsoft.com/fwlink/?LinkID=113326 +Get-PSDrive,https://go.microsoft.com/fwlink/?LinkID=113327 +Get-PSProvider,https://go.microsoft.com/fwlink/?LinkID=113329 +Get-PsSession,https://go.microsoft.com/fwlink/?LinkID=135219 +Get-PSSessionConfiguration,https://go.microsoft.com/fwlink/?LinkID=144304 +Get-PSSnapin,https://go.microsoft.com/fwlink/?LinkID=113330 +Get-Random,https://go.microsoft.com/fwlink/?LinkID=113446 +Get-Service,https://go.microsoft.com/fwlink/?LinkID=113332 +Get-TraceSource,https://go.microsoft.com/fwlink/?LinkID=113333 +Get-Transaction,https://go.microsoft.com/fwlink/?LinkID=135220 +Get-UICulture,https://go.microsoft.com/fwlink/?LinkID=113334 +Get-Unique,https://go.microsoft.com/fwlink/?LinkID=113335 +Get-Variable,https://go.microsoft.com/fwlink/?LinkID=113336 +Get-Verb,https://go.microsoft.com/fwlink/?LinkID=160712 +Get-WinEvent,https://go.microsoft.com/fwlink/?LinkID=138336 +Get-WmiObject,https://go.microsoft.com/fwlink/?LinkID=113337 +Get-WSManCredSSP,https://go.microsoft.com/fwlink/?LinkID=141443 +Get-WSManInstance,https://go.microsoft.com/fwlink/?LinkID=141444 +Group-Object,https://go.microsoft.com/fwlink/?LinkID=113338 +Import-Alias,https://go.microsoft.com/fwlink/?LinkID=113339 +Import-Clixml,https://go.microsoft.com/fwlink/?LinkID=113340 +Import-Counter,https://go.microsoft.com/fwlink/?LinkID=138338 +Import-Csv,https://go.microsoft.com/fwlink/?LinkID=113341 +Import-LocalizedData,https://go.microsoft.com/fwlink/?LinkID=113342 +Import-Module,https://go.microsoft.com/fwlink/?LinkID=141553 +Import-PsSession,https://go.microsoft.com/fwlink/?LinkID=135221 +Invoke-Command,https://go.microsoft.com/fwlink/?LinkID=135225 +Invoke-Expression,https://go.microsoft.com/fwlink/?LinkID=113343 +Invoke-History,https://go.microsoft.com/fwlink/?LinkID=113344 +Invoke-Item,https://go.microsoft.com/fwlink/?LinkID=113345 +Invoke-WmiMethod,https://go.microsoft.com/fwlink/?LinkID=113346 +Invoke-WSManAction,https://go.microsoft.com/fwlink/?LinkID=141446 +Join-Path,https://go.microsoft.com/fwlink/?LinkID=113347 +Limit-EventLog,https://go.microsoft.com/fwlink/?LinkID=135227 +Managing Errors,https://go.microsoft.com/fwlink/?LinkID=135228 +Measure-Command,https://go.microsoft.com/fwlink/?LinkID=113348 +Measure-Object,https://go.microsoft.com/fwlink/?LinkID=113349 +Move-Item,https://go.microsoft.com/fwlink/?LinkID=113350 +Move-ItemProperty,https://go.microsoft.com/fwlink/?LinkID=113351 +New-Alias,https://go.microsoft.com/fwlink/?LinkID=113352 +New-Event,https://go.microsoft.com/fwlink/?LinkID=135234 +New-EventLog,https://go.microsoft.com/fwlink/?LinkID=135235 +New-Item,https://go.microsoft.com/fwlink/?LinkID=113353 +New-Item for ClientCertificate,https://go.microsoft.com/fwlink/?LinkID=158676 +New-Item for InitializationParam,https://go.microsoft.com/fwlink/?LinkID=158677 +New-Item for Listener,https://go.microsoft.com/fwlink/?LinkID=158678 +New-Item for Plugin,https://go.microsoft.com/fwlink/?LinkID=158679 +New-Item for Resources,https://go.microsoft.com/fwlink/?LinkID=158680 +New-Item for Security,https://go.microsoft.com/fwlink/?LinkID=158681 +New-ItemProperty,https://go.microsoft.com/fwlink/?LinkID=113354 +New-Module,https://go.microsoft.com/fwlink/?LinkID=141554 +New-ModuleManifest,https://go.microsoft.com/fwlink/?LinkID=141555 +New-Object,https://go.microsoft.com/fwlink/?LinkID=113355 +New-PSDrive,https://go.microsoft.com/fwlink/?LinkID=113357 +New-PsSession,https://go.microsoft.com/fwlink/?LinkID=135237 +New-PSSessionOption,https://go.microsoft.com/fwlink/?LinkID=144305 +New-Service,https://go.microsoft.com/fwlink/?LinkID=113359 +New-TimeSpan,https://go.microsoft.com/fwlink/?LinkID=113360 +New-Variable,https://go.microsoft.com/fwlink/?LinkID=113361 +New-Webserviceproxy,https://go.microsoft.com/fwlink/?LinkID=135238 +New-WSManInstance,https://go.microsoft.com/fwlink/?LinkID=141448 +New-WSManSessionOption,https://go.microsoft.com/fwlink/?LinkID=141449 +Object Pipeline,https://go.microsoft.com/fwlink/?LinkID=135239 +Out-Default,https://go.microsoft.com/fwlink/?LinkID=113362 +Out-File,https://go.microsoft.com/fwlink/?LinkID=113363 +Out-GridView,https://go.microsoft.com/fwlink/?LinkID=113364 +Out-Host,https://go.microsoft.com/fwlink/?LinkID=113365 +Out-Null,https://go.microsoft.com/fwlink/?LinkID=113366 +Out-Printer,https://go.microsoft.com/fwlink/?LinkID=113367 +Out-String,https://go.microsoft.com/fwlink/?LinkID=113368 +Pop-Location,https://go.microsoft.com/fwlink/?LinkID=113369 +Push-Location,https://go.microsoft.com/fwlink/?LinkID=113370 +Read-Host,https://go.microsoft.com/fwlink/?LinkID=113371 +Receive-Job,https://go.microsoft.com/fwlink/?LinkID=113372 +Register-EngineEvent,https://go.microsoft.com/fwlink/?LinkID=135243 +Register-ObjectEvent,https://go.microsoft.com/fwlink/?LinkID=135244 +Register-PSSessionConfiguration,https://go.microsoft.com/fwlink/?LinkID=144306 +Register-WmiEvent,https://go.microsoft.com/fwlink/?LinkID=135245 +Remove-Computer,https://go.microsoft.com/fwlink/?LinkID=135246 +Remove-Event,https://go.microsoft.com/fwlink/?LinkID=135247 +Remove-EventLog,https://go.microsoft.com/fwlink/?LinkID=135248 +Remove-Item,https://go.microsoft.com/fwlink/?LinkID=113373 +Remove-ItemProperty,https://go.microsoft.com/fwlink/?LinkID=113374 +Remove-Job,https://go.microsoft.com/fwlink/?LinkID=113377 +Remove-Module,https://go.microsoft.com/fwlink/?LinkID=141556 +Remove-PSBreakpoint,https://go.microsoft.com/fwlink/?LinkID=113375 +Remove-PSDrive,https://go.microsoft.com/fwlink/?LinkID=113376 +Remove-PsSession,https://go.microsoft.com/fwlink/?LinkID=135250 +Remove-PSSnapin,https://go.microsoft.com/fwlink/?LinkID=113378 +Remove-Variable,https://go.microsoft.com/fwlink/?LinkID=113380 +Remove-WmiObject,https://go.microsoft.com/fwlink/?LinkID=113381 +Remove-WSManInstance,https://go.microsoft.com/fwlink/?LinkID=141453 +Rename-Item,https://go.microsoft.com/fwlink/?LinkID=113382 +Rename-ItemProperty,https://go.microsoft.com/fwlink/?LinkID=113383 +Reset-ComputerMachinePassword,https://go.microsoft.com/fwlink/?LinkID=135252 +Resolve-Path,https://go.microsoft.com/fwlink/?LinkID=113384 +Restart-Computer,https://go.microsoft.com/fwlink/?LinkID=135253 +Restart-Service,https://go.microsoft.com/fwlink/?LinkID=113385 +Restore-Computer,https://go.microsoft.com/fwlink/?LinkID=135254 +Resume-Service,https://go.microsoft.com/fwlink/?LinkID=113386 +Select-Object,https://go.microsoft.com/fwlink/?LinkID=113387 +Select-String,https://go.microsoft.com/fwlink/?LinkID=113388 +Select-Xml,https://go.microsoft.com/fwlink/?LinkID=135255 +Send-MailMessage,https://go.microsoft.com/fwlink/?LinkID=135256 +Set-Acl,https://go.microsoft.com/fwlink/?LinkID=113389 +Set-Alias,https://go.microsoft.com/fwlink/?LinkID=113390 +Set-AuthenticodeSignature,https://go.microsoft.com/fwlink/?LinkID=113391 +Set-Content,https://go.microsoft.com/fwlink/?LinkID=113392 +Set-Date,https://go.microsoft.com/fwlink/?LinkID=113393 +Set-ExecutionPolicy,https://go.microsoft.com/fwlink/?LinkID=113394 +Set-Item,https://go.microsoft.com/fwlink/?LinkID=113395 +Set-ItemProperty,https://go.microsoft.com/fwlink/?LinkID=113396 +Set-Location,https://go.microsoft.com/fwlink/?LinkID=113397 +Set-PSBreakpoint,https://go.microsoft.com/fwlink/?LinkID=113449 +Set-PSDebug,https://go.microsoft.com/fwlink/?LinkID=113398 +Set-PSSessionConfiguration,https://go.microsoft.com/fwlink/?LinkID=144307 +Set-Service,https://go.microsoft.com/fwlink/?LinkID=113399 +Set-StrictMode,https://go.microsoft.com/fwlink/?LinkID=113450 +Set-TraceSource,https://go.microsoft.com/fwlink/?LinkID=113400 +Set-Variable,https://go.microsoft.com/fwlink/?LinkID=113401 +Set-WmiInstance,https://go.microsoft.com/fwlink/?LinkID=113402 +Set-WSManInstance,https://go.microsoft.com/fwlink/?LinkID=141458 +Set-WSManQuickConfig,https://go.microsoft.com/fwlink/?LinkID=141463 +Show-Eventlog,https://go.microsoft.com/fwlink/?LinkID=135257 +Sort-Object,https://go.microsoft.com/fwlink/?LinkID=113403 +Split-Path,https://go.microsoft.com/fwlink/?LinkID=113404 +Start-Job,https://go.microsoft.com/fwlink/?LinkID=113405 +Start-Process,https://go.microsoft.com/fwlink/?LinkID=135261 +Start-Service,https://go.microsoft.com/fwlink/?LinkID=113406 +Start-Sleep,https://go.microsoft.com/fwlink/?LinkID=113407 +Start-Transaction,https://go.microsoft.com/fwlink/?LinkID=135262 +Start-Transcript,https://go.microsoft.com/fwlink/?LinkID=113408 +Stop-Computer,https://go.microsoft.com/fwlink/?LinkID=135263 +Stop-Job,https://go.microsoft.com/fwlink/?LinkID=113413 +Stop-Process,https://go.microsoft.com/fwlink/?LinkID=113412 +Stop-Service,https://go.microsoft.com/fwlink/?LinkID=113414 +Stop-Transcript,https://go.microsoft.com/fwlink/?LinkID=113415 +Suspend-Service,https://go.microsoft.com/fwlink/?LinkID=113416 +Tee-Object,https://go.microsoft.com/fwlink/?LinkID=113417 +Test-ComputerSecureChannel,https://go.microsoft.com/fwlink/?LinkID=137749 +Test-Connection,https://go.microsoft.com/fwlink/?LinkID=135266 +Test-ModuleManifest,https://go.microsoft.com/fwlink/?LinkID=141557 +Test-Path,https://go.microsoft.com/fwlink/?LinkID=113418 +Test-WSMan,https://go.microsoft.com/fwlink/?LinkID=141464 +Trace-Command,https://go.microsoft.com/fwlink/?LinkID=113419 +Undo-Transaction,https://go.microsoft.com/fwlink/?LinkID=135268 +Unregister-Event,https://go.microsoft.com/fwlink/?LinkID=135269 +Unregister-PSSessionConfiguration,https://go.microsoft.com/fwlink/?LinkID=144308 +Update-FormatData,https://go.microsoft.com/fwlink/?LinkID=113420 +Update-List,https://go.microsoft.com/fwlink/?LinkID=113447 +Update-TypeData,https://go.microsoft.com/fwlink/?LinkID=113421 +Use-Transaction,https://go.microsoft.com/fwlink/?LinkID=135271 +Wait-Event,https://go.microsoft.com/fwlink/?LinkID=135276 +Wait-Job,https://go.microsoft.com/fwlink/?LinkID=113422 +Wait-Process,https://go.microsoft.com/fwlink/?LinkID=135277 +Where-Object,https://go.microsoft.com/fwlink/?LinkID=113423 +Write-Debug,https://go.microsoft.com/fwlink/?LinkID=113424 +Write-Error,https://go.microsoft.com/fwlink/?LinkID=113425 +Write-EventLog,https://go.microsoft.com/fwlink/?LinkID=135281 +Write-Host,https://go.microsoft.com/fwlink/?LinkID=113426 +Write-Output,https://go.microsoft.com/fwlink/?LinkID=113427 +Write-Progress,https://go.microsoft.com/fwlink/?LinkID=113428 +Write-Verbose,https://go.microsoft.com/fwlink/?LinkID=113429 +Write-Warning,https://go.microsoft.com/fwlink/?LinkID=113430 +Clear-Host,https://go.microsoft.com/fwlink/?LinkID=225747 +Prompt,https://go.microsoft.com/fwlink/?LinkID=225750 diff --git a/test/powershell/engine/testdata/HelpURI/V3Cmdlets.csv b/test/powershell/engine/testdata/HelpURI/V3Cmdlets.csv new file mode 100644 index 0000000000..cbc2c68e08 --- /dev/null +++ b/test/powershell/engine/testdata/HelpURI/V3Cmdlets.csv @@ -0,0 +1,92 @@ +TopicTitle,HelpURI +Add-ContentFileSystem,https://go.microsoft.com/fwlink/?LinkID=204573 +Add-JobTrigger,https://go.microsoft.com/fwlink/?LinkID=223913 +Connect-PSSession,https://go.microsoft.com/fwlink/?LinkID=210604 +ConvertFrom-Json,https://go.microsoft.com/fwlink/?LinkID=217031 +ConvertTo-Json,https://go.microsoft.com/fwlink/?LinkID=217032 +Disable-JobTrigger,https://go.microsoft.com/fwlink/?LinkID=223918 +Disable-ScheduledJob,https://go.microsoft.com/fwlink/?LinkID=223927 +Disconnect-PSSession,https://go.microsoft.com/fwlink/?LinkID=210605 +Enable-JobTrigger,https://go.microsoft.com/fwlink/?LinkID=223917 +Enable-ScheduledJob,https://go.microsoft.com/fwlink/?LinkID=223926 +Get-ChildItemFileSystem,https://go.microsoft.com/fwlink/?LinkID=204557 +Get-ContentFileSystem,https://go.microsoft.com/fwlink/?LinkID=204574 +Get-ControlPanelItem,https://go.microsoft.com/fwlink/?LinkID=219982 +Get-CmsMessage,https://go.microsoft.com/fwlink/?LinkID=394370 +Get-JobTrigger,https://go.microsoft.com/fwlink/?LinkID=223915 +Get-ScheduledJob,https://go.microsoft.com/fwlink/?LinkID=223923 +Get-ScheduledJobOption,https://go.microsoft.com/fwlink/?LinkID=223920 +Get-TypeData,https://go.microsoft.com/fwlink/?LinkID=217033 +Import-PSWorkflow,https://go.microsoft.com/fwlink/?LinkID=210606 +Invoke-RestMethod,https://go.microsoft.com/fwlink/?LinkID=217034 +Invoke-WebRequest,https://go.microsoft.com/fwlink/?LinkID=217035 +New-CIMModule,https://go.microsoft.com/fwlink/?LinkID=210607 +New-JobTrigger,https://go.microsoft.com/fwlink/?LinkID=223912 +New-PSSessionConfigurationFile,https://go.microsoft.com/fwlink/?LinkID=217036 +New-PSSessionConfigurationOption,https://go.microsoft.com/fwlink/?LinkID=210608 +New-PSWorkflowExecutionOption,https://go.microsoft.com/fwlink/?LinkID=210609 +New-ScheduledJobOption,https://go.microsoft.com/fwlink/?LinkID=223919 +New-Snippet,https://go.microsoft.com/fwlink/?LinkID=225298 +New-WinEvent,https://go.microsoft.com/fwlink/?LinkID=217469 +Out-LineOutput,https://go.microsoft.com/fwlink/?LinkID=210610 +Protect-CmsMessage,https://go.microsoft.com/fwlink/?LinkId=394373 +Receive-PSSession,https://go.microsoft.com/fwlink/?LinkID=217037 +Register-JobEvent,https://go.microsoft.com/fwlink/?LinkID=221730 +Register-ScheduledJob,https://go.microsoft.com/fwlink/?LinkID=223922 +Remove-JobTrigger,https://go.microsoft.com/fwlink/?LinkID=223914 +Remove-TypeData,https://go.microsoft.com/fwlink/?LinkID=217038 +Rename-Computer,https://go.microsoft.com/fwlink/?LinkID=219990 +Resume-Job,https://go.microsoft.com/fwlink/?LinkID=210611 +Save-Help,https://go.microsoft.com/fwlink/?LinkID=210612 +Set-ContentFileSystem,https://go.microsoft.com/fwlink/?LinkID=204570 +Set-JobTrigger,https://go.microsoft.com/fwlink/?LinkID=223916 +Set-ScheduledJob,https://go.microsoft.com/fwlink/?LinkID=223924 +Set-ScheduledJobOption,https://go.microsoft.com/fwlink/?LinkID=223921 +Show-Command,https://go.microsoft.com/fwlink/?LinkID=217448 +Show-ControlPanelItem,https://go.microsoft.com/fwlink/?LinkID=219983 +Suspend-Job,https://go.microsoft.com/fwlink/?LinkID=210613 +Test-PSSessionConfigurationFile,https://go.microsoft.com/fwlink/?LinkID=217039 +Unblock-File,https://go.microsoft.com/fwlink/?LinkID=217450 +Unprotect-CmsMessage,https://go.microsoft.com/fwlink/?LinkId=394374 +Unregister-ScheduledJob,https://go.microsoft.com/fwlink/?LinkID=223925 +Update-Help,https://go.microsoft.com/fwlink/?LinkID=210614 +Get-ItemPropertyValue,https://go.microsoft.com/fwlink/?LinkId=389281 +Compress-Archive,https://go.microsoft.com/fwlink/?LinkID=393252 +Expand-Archive,https://go.microsoft.com/fwlink/?LinkID=393253 +Get-Runspace,https://go.microsoft.com/fwlink/?LinkId=403730 +Debug-Runspace,https://go.microsoft.com/fwlink/?LinkId=403731 +Enable-RunspaceDebug,https://go.microsoft.com/fwlink/?LinkId=403732 +Disable-RunspaceDebug,https://go.microsoft.com/fwlink/?LinkId=403733 +Get-RunspaceDebug,https://go.microsoft.com/fwlink/?LinkId=403734 +Wait-Debugger,https://go.microsoft.com/fwlink/?LinkId=403735 +Enter-PSHostProcess,https://go.microsoft.com/fwlink/?LinkId=403736 +Exit-PSHostProcess,https://go.microsoft.com/fwlink/?LinkId=403737 +Clear-RecycleBin,https://go.microsoft.com/fwlink/?LinkId=524082 +ConvertFrom-String,https://go.microsoft.com/fwlink/?LinkId=507579 +New-TemporaryFile,https://go.microsoft.com/fwlink/?LinkId=526726 +New-Guid,https://go.microsoft.com/fwlink/?LinkId=526920 +Format-Hex,https://go.microsoft.com/fwlink/?LinkId=526919 +Convert-String,https://go.microsoft.com/fwlink/?LinkId=528577 +Get-Clipboard,https://go.microsoft.com/fwlink/?LinkId=526219 +Set-Clipboard,https://go.microsoft.com/fwlink/?LinkId=526220 +Write-Information,https://go.microsoft.com/fwlink/?LinkId=525909 +Add-LocalGroupMember,https://go.microsoft.com/fwlink/?LinkId=717987 +Disable-LocalUser,https://go.microsoft.com/fwlink/?LinkId=717986 +Enable-LocalUser,https://go.microsoft.com/fwlink/?LinkId=717985 +Get-LocalGroup,https://go.microsoft.com/fwlink/?LinkId=717974 +Get-LocalGroupMember,https://go.microsoft.com/fwlink/?LinkId=717988 +Get-LocalUser,https://go.microsoft.com/fwlink/?LinkId=717980 +New-LocalGroup,https://go.microsoft.com/fwlink/?LinkId=717990 +New-LocalUser,https://go.microsoft.com/fwlink/?LinkId=717981 +Remove-LocalGroup,https://go.microsoft.com/fwlink/?LinkId=717975 +Remove-LocalGroupMember,https://go.microsoft.com/fwlink/?LinkId=717989 +Remove-LocalUser,https://go.microsoft.com/fwlink/?LinkId=717982 +Rename-LocalGroup,https://go.microsoft.com/fwlink/?LinkId=717978 +Rename-LocalUser,https://go.microsoft.com/fwlink/?LinkID=717983 +Set-LocalGroup,https://go.microsoft.com/fwlink/?LinkId=717979 +Set-LocalUser,https://go.microsoft.com/fwlink/?LinkId=717984 +New-FileCatalog,https://go.microsoft.com/fwlink/?LinkId=786749 +Test-FileCatalog,https://go.microsoft.com/fwlink/?LinkId=786750 +Get-ComputerInfo,https://go.microsoft.com/fwlink/?LinkId=799466 +Get-TimeZone,https://go.microsoft.com/fwlink/?LinkId=799468 +Set-TimeZone,https://go.microsoft.com/fwlink/?LinkId=799469 \ No newline at end of file