Public/Get-About.ps1

<#
 
# Get-About
 
Öffnet eine Hilfe-About-Seite nach Auswahl (Out-GridView) in einem neuen Fenster. Nach einem Schlagwort kann gesucht werden.
 
- **Hashtags** UserCmdlet
- **Version** 2019.09.09
 
#>


using namespace System
using namespace System.Runtime.InteropServices
$ErrorActionPreference = [System.Management.Automation.ActionPreference]::Stop
Set-StrictMode -Version Latest

function Get-About {
    <#
        .Synopsis
            Öffnet Hilfe-About-Seite
         
        .DESCRIPTION
            Öffnet eine Hilfe-About-Seite nach Auswahl (Out-GridView) in einem
            neuen Fenster. Nach einem Schlagwort kann gesucht werden.
         
        .EXAMPLE
            Get-About
            Zeigt alle About_*-Seiten an.
         
        .EXAMPLE
            Get-About -KeyWord 'function'
            Zeigt alle About_*function*-Seiten an.
    #>

    [CmdletBinding()]
    #[Alias("ga")]
    Param
    (
        # About-Pagename Searchword
        [Parameter(Mandatory=$false, 
                   ValueFromPipeline=$true,
                   ValueFromPipelineByPropertyName=$true, 
                   Position=0,
                   ParameterSetName='Keyword')]
        [ValidateLength(0,15)]
        [string]$KeyWord = [string]::Empty
    )

    Begin {}
    
    Process
    {
        $abouts = Get-Help "about_*$KeyWord*"
        Write-Information -MessageData ("Gefundene About-Seiten: {0}" -f ($abouts | Measure-Object).Count)
        $abouts | 
            Sort-Object -Property Name | 
            Select-Object -Property Name, Synopsis, Length | 
            Out-GridView -Title "Hilfe-Seite auswählen" -OutputMode Multiple | 
            ForEach-Object -Process {
                $_.Name
                $_ | Get-Help -ShowWindow
            }
    }

    End {}
}