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
Original file line number Diff line number Diff line change
Expand Up @@ -313,13 +313,20 @@ private HelpInfo GetHelpInfo(CommandInfo commandInfo, bool reportErrors, bool se
// and the nested module that implements the command
GetModulePaths(commandInfo, out moduleName, out moduleDir, out nestedModulePath);

Collection<String> searchPaths = new Collection<String>(){ HelpUtils.GetUserHomeHelpSearchPath() };
var userHomeHelpPath = HelpUtils.GetUserHomeHelpSearchPath();

Collection<string> searchPaths = new Collection<string>() { userHomeHelpPath };

if (!String.IsNullOrEmpty(moduleDir))
{
searchPaths.Add(moduleDir);
}

if (!String.IsNullOrEmpty(userHomeHelpPath) && !String.IsNullOrEmpty(moduleName))
{
searchPaths.Add(Path.Combine(userHomeHelpPath, moduleName));
}

if (!String.IsNullOrEmpty(moduleName) && !String.IsNullOrEmpty(moduleDir))
{
// Search for <ModuleName>-Help.xml under ModuleBase folder
Expand Down
20 changes: 10 additions & 10 deletions test/powershell/engine/Help/HelpSystem.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ Describe 'help can be found for CurrentUser Scope' -Tags 'CI' {
Remove-Item $userHelpRoot -Force -ErrorAction SilentlyContinue -Recurse
UpdateHelpFromLocalContentPath -ModuleName 'Microsoft.PowerShell.Core' -Scope 'CurrentUser'
UpdateHelpFromLocalContentPath -ModuleName 'Microsoft.PowerShell.Management' -Scope 'CurrentUser'
UpdateHelpFromLocalContentPath -ModuleName 'PSReadLine' -Scope CurrentUser -Force
UpdateHelpFromLocalContentPath -ModuleName 'Microsoft.PowerShell.Archive' -Scope 'CurrentUser' -Force
UpdateHelpFromLocalContentPath -ModuleName 'PackageManagement' -Scope CurrentUser -Force

## Delete help from global scope if it exists.
Expand All @@ -401,15 +401,15 @@ Describe 'help can be found for CurrentUser Scope' -Tags 'CI' {
Remove-Item $coreHelpFilePath -Force -ErrorAction SilentlyContinue
}

$psreadlineHelpFilePath = Join-Path (Get-Module PSReadLine -ListAvailable).ModuleBase -ChildPath $currentCulture -AdditionalChildPath 'Microsoft.PowerShell.PSReadLine.dll-Help.xml'
if (Test-Path $psreadlineHelpFilePath) {
Remove-Item $psreadlineHelpFilePath -Force -ErrorAction SilentlyContinue
$archiveHelpFilePath = Join-Path (Get-Module Microsoft.PowerShell.Archive -ListAvailable).ModuleBase -ChildPath $currentCulture -AdditionalChildPath 'Microsoft.PowerShell.Archive-help.xml'
if (Test-Path $archiveHelpFilePath) {
Remove-Item $archiveHelpFilePath -Force -ErrorAction SilentlyContinue
}

$TestCases = @(
@{TestName = 'module under $PSHOME'; CmdletName = 'Add-Content'}
@{TestName = 'module is a PSSnapin'; CmdletName = 'Get-Command' }
@{TestName = 'module is under $PSHOME\Modules'; CmdletName = 'Get-PSReadlineOption' }
@{TestName = 'module is under $PSHOME\Modules'; CmdletName = 'Compress-Archive' }
@{TestName = 'module has a version folder'; CmdletName = 'Find-Package' }
)
}
Expand Down Expand Up @@ -442,20 +442,20 @@ Describe 'help can be found for AllUsers Scope' -Tags @('Feature', 'RequireAdmin
Remove-Item $coreHelpFilePath -Force -ErrorAction SilentlyContinue
}

$psreadlineHelpFilePath = Join-Path (Get-Module PSReadLine -ListAvailable).ModuleBase -ChildPath $currentCulture -AdditionalChildPath 'Microsoft.PowerShell.PSReadLine.dll-Help.xml'
if (Test-Path $psreadlineHelpFilePath) {
Remove-Item $psreadlineHelpFilePath -Force -ErrorAction SilentlyContinue
$archiveHelpFilePath = Join-Path (Get-Module Microsoft.PowerShell.Archive -ListAvailable).ModuleBase -ChildPath $currentCulture -AdditionalChildPath 'Microsoft.PowerShell.Archive-help.xml'
if (Test-Path $archiveHelpFilePath) {
Remove-Item $archiveHelpFilePath -Force -ErrorAction SilentlyContinue
}

UpdateHelpFromLocalContentPath -ModuleName 'Microsoft.PowerShell.Core' -Scope 'AllUsers'
UpdateHelpFromLocalContentPath -ModuleName 'Microsoft.PowerShell.Management' -Scope 'AllUsers'
UpdateHelpFromLocalContentPath -ModuleName 'PSReadLine' -Scope 'AllUsers' -Force
UpdateHelpFromLocalContentPath -ModuleName 'Microsoft.PowerShell.Archive' -Scope 'AllUsers' -Force
UpdateHelpFromLocalContentPath -ModuleName 'PackageManagement' -Scope 'AllUsers' -Force

$TestCases = @(
@{TestName = 'module under $PSHOME'; CmdletName = 'Add-Content'}
@{TestName = 'module is a PSSnapin'; CmdletName = 'Get-Command' }
@{TestName = 'module is under $PSHOME\Modules'; CmdletName = 'Get-PSReadlineOption' }
@{TestName = 'module is under $PSHOME\Modules'; CmdletName = 'Compress-Archive' }
@{TestName = 'module has a version folder'; CmdletName = 'Find-Package' }
)
}
Expand Down
15 changes: 1 addition & 14 deletions test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ $powershellCoreModules = @(
"Microsoft.WsMan.Management"
"PackageManagement"
# "PowershellGet"
"PSReadline"
)

# The file extension for the help content on the Download Center.
Expand Down Expand Up @@ -53,16 +52,12 @@ $testCases = @{
HelpInstallationPathHome = "$userHelpRoot\CimCmdlets\en-US"
}

<#
This scenario is broken due to issue # https://github.com/PowerShell/platyPS/issues/241
Re-enable when issue is fixed.
"Microsoft.PowerShell.Archive" = @{
HelpFiles = "Microsoft.PowerShell.Archive.psm1-help.xml"
HelpFiles = "Microsoft.PowerShell.Archive-help.xml"
HelpInfoFiles = "Microsoft.PowerShell.Archive_eb74e8da-9ae2-482a-a648-e96550fb8733_HelpInfo.xml"
CompressedFiles = "Microsoft.PowerShell.Archive_eb74e8da-9ae2-482a-a648-e96550fb8733_en-US_HelpContent$extension"
HelpInstallationPath = "$pshome\Modules\Microsoft.PowerShell.Archive\en-US"
}
#>

"Microsoft.PowerShell.Core" = @{
HelpFiles = "System.Management.Automation.dll-help.xml"
Expand Down Expand Up @@ -143,14 +138,6 @@ $testCases = @{
HelpInstallationPath = "$pshome\Modules\PowershellGet\en-US"
HelpInstallationPathHome = "$userHelpRoot\PackageManagement\en-US"
}

"PSReadline" = @{
HelpFiles = "Microsoft.PowerShell.PSReadLine.dll-help.xml"
HelpInfoFiles = "PSReadline_5714753b-2afd-4492-a5fd-01d9e2cff8b5_HelpInfo.xml"
CompressedFiles = "PSReadline_5714753b-2afd-4492-a5fd-01d9e2cff8b5_en-US_helpcontent$extension"
HelpInstallationPath = "$pshome\Modules\PSReadLine\en-US"
HelpInstallationPathHome = "$userHelpRoot\PSReadLine\en-US"
}
}

# These are the inbox modules.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<SupportedUICultures>
<UICulture>
<UICultureName>en-US</UICultureName>
<UICultureVersion>5.0.2.0</UICultureVersion>
<UICultureVersion>6.1.0.1</UICultureVersion>
</UICulture>
</SupportedUICultures>
</HelpInfo>
Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.