Unresolved "about" references in PoSh on-line help

Tech-Archive recommends: Speed Up your PC by fixing your registry



There are still a bunch of unresolved "about" references in the on-line help.
I know that documentation is still being finalized, but I though may be
simple code snippet will save a bit of time and frustration for someone who's
trying to follow all the "about" references.

$dangling_refs = @{}
$format = @{ Expression = {$_.Name}; Label = "Unresolved reference"}, @{
Expression = {$_.Value}; Label = "Referenced in"}
$rx = new-object regex("\bhelp[ ]\b(?<about_ref>about_[\w]+)\b",
"Compiled,IgnoreCase")

foreach ($help_file in (get-childitem -path "$env:ProgramFiles\Windows
PowerShell\v1.0\en" -filter "*.help.txt"))
{
foreach($mtch in ($rx.Matches([String](get-content -Path
$help_file.FullName -ReadCount 0))))
{
$candidate = $mtch.groups["about_ref"].value
if ( -not (test-path "$env:ProgramFiles\Windows
PowerShell\v1.0\en\$candidate.help.txt") )
{
if (-not ($dangling_refs[$candidate] -contains $help_file.Name))
{
$dangling_refs[$candidate] = $dangling_refs[$candidate] +
@($help_file.Name)
}
}
}
}

$dangling_refs | ft $format -wrap
"Total count: " + $dangling_refs.Count

On my box with RC1 the list looks like follows:

$dangling_refs = @{}
$format = @{ Expression = {$_.Name}; Label = "Unresolved reference"}, @{
Expression = {$_.Value}; Label = "Referenced in"}
$rx = new-object regex("\bhelp[ ]\b(?<about_ref>about_[\w]+)\b",
"Compiled,IgnoreCase")

foreach ($help_file in (get-childitem -path "$env:ProgramFiles\Windows
PowerShell\v1.0\en" -filter "*.help.txt"))
{
foreach($mtch in ($rx.Matches([String](get-content -Path
$help_file.FullName -ReadCount 0))))
{
$candidate = $mtch.groups["about_ref"].value
if ( -not (test-path "$env:ProgramFiles\Windows
PowerShell\v1.0\en\$candidate.help.txt") )
{
if (-not ($dangling_refs[$candidate] -contains $help_file.Name))
{
$dangling_refs[$candidate] = $dangling_refs[$candidate] +
@($help_file.Name)
}
}
}
}

$dangling_refs | ft $format -wrap
"Total count: " + $dangling_refs.Count

Unresolved reference Referenced in
-------------------- -------------
about_script_file {about_foreach.help.txt,
about_Function
.help.txt}
about_error_handling about_system_state.help.txt
about_variable {about_Alias.help.txt,
about_Assignment
_operators.help.txt,
about_Function.hel
p.txt,
about_Quoting_rules.help.txt...}
about_policy_variable about_Shell_variable.help.txt
about_data_type
{about_Assignment_operators.help.txt, a
bout_types.ps1xml.help.txt}
about_profile {about_Function.help.txt,
about_History
.help.txt}
about_do about_break.help.txt
about_wildcards default.help.txt
about_unary_operator about_operator.help.txt
about_operator_precedence about_operator.help.txt
about_special_operator about_operator.help.txt

Total count: 11
.



Relevant Pages

  • Re: Annedoti, Anon (Re: A China-Sumer connection)
    ... >> not familiar with any of them wearing fish costumes. ... > I don't have references on hand - and even if I found some by digging thru ... >> they displayed your level of erudition and documentation, ... Sumerian site. ...
    (sci.archaeology)
  • Re: Annedoti, Anon (Re: A China-Sumer connection)
    ... >> not familiar with any of them wearing fish costumes. ... > I don't have references on hand - and even if I found some by digging thru ... >> they displayed your level of erudition and documentation, ... Sumerian site. ...
    (sci.anthropology)
  • Re: Annedoti, Anon (Re: A China-Sumer connection)
    ... >> not familiar with any of them wearing fish costumes. ... > I don't have references on hand - and even if I found some by digging thru ... >> they displayed your level of erudition and documentation, ... Sumerian site. ...
    (sci.lang)
  • Fixing 2.6.0s broken documentation references
    ... I've noted that 2.6.0 contains broken references to documentation. ... I got sufficiently annoyed chasing doc files in the wrong place ... that I wrote a script to check the references to documentation ...
    (Linux-Kernel)
  • Re: String in VB
    ... | Any references to documentation where this is written? ... Yes, Armin told you where: ... |> function be the destination of an assignment? ...
    (microsoft.public.dotnet.languages.vb)