Skip to content
Merged
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
33 changes: 32 additions & 1 deletion test/powershell/engine/Help/HelpSystem.OnlineHelp.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,39 @@ Describe 'Get-Help -Online opens the default web browser and navigates to the cm
$skipTest = [System.Management.Automation.Platform]::IsIoT -or
[System.Management.Automation.Platform]::IsNanoServer

It "Get-Help get-process -online" -skip:$skipTest {
# this code is a workaround for issue: https://github.com/PowerShell/PowerShell/issues/3079
if((-not ($skipTest)) -and $IsWindows)
{
$skipTest = $true
$regKey = "HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice"

try
{
$progId = [Microsoft.Win32.Registry]::GetValue($regKey, "ProgId", $null)
if($progId)
{
$browserKey = [Microsoft.Win32.Registry]::ClassesRoot.OpenSubKey("$progId\shell\open\command", $false)
if($browserKey)
{
$browserExe = ($browserKey.GetValue($null) -replace '"', '') -split " "

if ($browserExe.count -ge 1)
{
if($browserExe[0] -match '.exe')
{
$skipTest = $false
}
}
}
}
}
catch
{
# We are not able to access Registry, skipping test.
}
}

It "Get-Help get-process -online" -skip:$skipTest {
{ Get-Help get-process -online } | Should Not Throw
}
}
Expand Down