Author Posts

July 8, 2017 at 10:19 pm

When running Get-Help against the about_ HelpFile for the following three modules it returns duplicates and doesn't run the help:
CimCmdlets
PSScheduledJob
PSWorkflow

Here is an example with about_CimSession:

PS G:\Powershell> Get-Help about_CimSession

Name                              Category  Module                    Synopsis
----                              --------  ------                    --------
about_CimSession                  HelpFile                            Describes a CimSession object and the difference between...
about_CimSession                  HelpFile                            Describes a CimSession object and the difference between...

I set up the following variables to see which help files are being duplicated:

$sys32Help = Get-ChildItem -Path "C:\Windows\System32\WindowsPowerShell\v1.0\en-US\" -Filter {*help*}
$sys32ModHelp = Get-ChildItem -Path "C:\Windows\System32\WindowsPowerShell\v1.0\Modules" -Filter {*help*} -Recurse -File
$compare = Compare-Object -ReferenceObject $sys32Help -DifferenceObject $sys32ModHelp -Property name -IncludeEqual
$compEQ = $compare | where sideIndicator -eq ==

The output of $compEQ on my computer:

PS G:\Powershell> $compEQ

name                                          SideIndicator
----                                          -------------
about_CimSession.help.txt                     ==
about_Scheduled_Jobs.help.txt                 ==
about_Scheduled_Jobs_Advanced.help.txt        ==
about_Scheduled_Jobs_Basics.help.txt          ==
about_Scheduled_Jobs_Troubleshooting.help.txt ==
about_ActivityCommonParameters.help.txt       ==
about_Checkpoint-Workflow.help.txt            ==
about_ForEach-Parallel.help.txt               ==
about_InlineScript.help.txt                   ==
about_Parallel.help.txt                       ==
about_Sequence.help.txt                       ==
about_Suspend-Workflow.help.txt               ==
about_WorkflowCommonParameters.help.txt       ==
about_Workflows.help.txt                      ==

To test I did change the about_CimSession.help.txt files to about_CimSession.help.txt.old in the modules directory from above.
I was able to successfully run 'Get-Help about_CimSession' after that.

Which help files can I safely delete, if any?

Is there a reason why just these modules' help files would be duplicated?

July 9, 2017 at 1:58 pm

I've not run into that, personally. It should be safe to delete them all, and run Update-Help to reload them from source.

November 6, 2017 at 9:55 am

Thank you for suggesting this. I was running into the same issue. I have created a script out of these commands and I am running this script after running the help updates to fix the duplicate entries:

$sys32Help = Get-ChildItem -Path "C:\Windows\System32\WindowsPowerShell\v1.0\en-US\" -Filter {*help*}
$sys32ModHelp = Get-ChildItem -Path "C:\Windows\System32\WindowsPowerShell\v1.0\Modules" -Filter {*help*} -Recurse -File
$compare = Compare-Object -ReferenceObject $sys32Help -DifferenceObject $sys32ModHelp -Property name -IncludeEqual
$compEQ = $compare | where sideIndicator -eq == | Select name | %{ $_.Name }
$sys32ModHelp | ?{ $_.Name -in $compEQ } | %{ Remove-Item -Path $_.FullName -Force -ErrorAction SilentlyContinue}