diff --git a/src/System.Management.Automation/help/CommandHelpProvider.cs b/src/System.Management.Automation/help/CommandHelpProvider.cs index 3a92ba1cdcc..3cb8c86785a 100644 --- a/src/System.Management.Automation/help/CommandHelpProvider.cs +++ b/src/System.Management.Automation/help/CommandHelpProvider.cs @@ -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 searchPaths = new Collection(){ HelpUtils.GetUserHomeHelpSearchPath() }; + var userHomeHelpPath = HelpUtils.GetUserHomeHelpSearchPath(); + + Collection searchPaths = new Collection() { 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 -Help.xml under ModuleBase folder diff --git a/test/powershell/engine/Help/HelpSystem.Tests.ps1 b/test/powershell/engine/Help/HelpSystem.Tests.ps1 index 7b22e1e84e5..5c796105f49 100644 --- a/test/powershell/engine/Help/HelpSystem.Tests.ps1 +++ b/test/powershell/engine/Help/HelpSystem.Tests.ps1 @@ -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. @@ -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' } ) } @@ -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' } ) } diff --git a/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 b/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 index eab542cd89d..19e8a506cfe 100644 --- a/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 +++ b/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 @@ -20,7 +20,6 @@ $powershellCoreModules = @( "Microsoft.WsMan.Management" "PackageManagement" # "PowershellGet" - "PSReadline" ) # The file extension for the help content on the Download Center. @@ -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" @@ -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. diff --git a/test/powershell/engine/Help/assets/Microsoft.PowerShell.Archive_eb74e8da-9ae2-482a-a648-e96550fb8733_HelpInfo.xml b/test/powershell/engine/Help/assets/Microsoft.PowerShell.Archive_eb74e8da-9ae2-482a-a648-e96550fb8733_HelpInfo.xml index 36e9045ee94..5940413491a 100644 --- a/test/powershell/engine/Help/assets/Microsoft.PowerShell.Archive_eb74e8da-9ae2-482a-a648-e96550fb8733_HelpInfo.xml +++ b/test/powershell/engine/Help/assets/Microsoft.PowerShell.Archive_eb74e8da-9ae2-482a-a648-e96550fb8733_HelpInfo.xml @@ -4,7 +4,7 @@ en-US - 5.0.2.0 + 6.1.0.1 \ No newline at end of file diff --git a/test/powershell/engine/Help/assets/Microsoft.PowerShell.Archive_eb74e8da-9ae2-482a-a648-e96550fb8733_en-US_HelpContent.cab b/test/powershell/engine/Help/assets/Microsoft.PowerShell.Archive_eb74e8da-9ae2-482a-a648-e96550fb8733_en-US_HelpContent.cab index d225c63d9d5..49cbbb7c6a0 100644 Binary files a/test/powershell/engine/Help/assets/Microsoft.PowerShell.Archive_eb74e8da-9ae2-482a-a648-e96550fb8733_en-US_HelpContent.cab and b/test/powershell/engine/Help/assets/Microsoft.PowerShell.Archive_eb74e8da-9ae2-482a-a648-e96550fb8733_en-US_HelpContent.cab differ diff --git a/test/powershell/engine/Help/assets/Microsoft.PowerShell.Archive_eb74e8da-9ae2-482a-a648-e96550fb8733_en-US_HelpContent.zip b/test/powershell/engine/Help/assets/Microsoft.PowerShell.Archive_eb74e8da-9ae2-482a-a648-e96550fb8733_en-US_HelpContent.zip index a5e89d03208..c81a237473a 100644 Binary files a/test/powershell/engine/Help/assets/Microsoft.PowerShell.Archive_eb74e8da-9ae2-482a-a648-e96550fb8733_en-US_HelpContent.zip and b/test/powershell/engine/Help/assets/Microsoft.PowerShell.Archive_eb74e8da-9ae2-482a-a648-e96550fb8733_en-US_HelpContent.zip differ diff --git a/test/powershell/engine/Help/assets/PSReadline_5714753b-2afd-4492-a5fd-01d9e2cff8b5_HelpInfo.xml b/test/powershell/engine/Help/assets/PSReadline_5714753b-2afd-4492-a5fd-01d9e2cff8b5_HelpInfo.xml deleted file mode 100644 index eb1634001a4..00000000000 --- a/test/powershell/engine/Help/assets/PSReadline_5714753b-2afd-4492-a5fd-01d9e2cff8b5_HelpInfo.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - https://go.microsoft.com/fwlink/?linkid=855966 - - - en-US - 5.0.4.0 - - - \ No newline at end of file diff --git a/test/powershell/engine/Help/assets/PSReadline_5714753b-2afd-4492-a5fd-01d9e2cff8b5_en-US_helpcontent.cab b/test/powershell/engine/Help/assets/PSReadline_5714753b-2afd-4492-a5fd-01d9e2cff8b5_en-US_helpcontent.cab deleted file mode 100644 index 04bcec718b3..00000000000 Binary files a/test/powershell/engine/Help/assets/PSReadline_5714753b-2afd-4492-a5fd-01d9e2cff8b5_en-US_helpcontent.cab and /dev/null differ diff --git a/test/powershell/engine/Help/assets/PSReadline_5714753b-2afd-4492-a5fd-01d9e2cff8b5_en-US_helpcontent.zip b/test/powershell/engine/Help/assets/PSReadline_5714753b-2afd-4492-a5fd-01d9e2cff8b5_en-US_helpcontent.zip deleted file mode 100644 index 0c75db6ce65..00000000000 Binary files a/test/powershell/engine/Help/assets/PSReadline_5714753b-2afd-4492-a5fd-01d9e2cff8b5_en-US_helpcontent.zip and /dev/null differ