Public/Get-TypeDocumentation.ps1

<#
 
# Get-TypeDocumentation
 
 
 
- **Hashtags** UserCmdlet Type Analyse
- **Version** 2020.06.25
 
#>


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

function Get-TypeDocumentation {
    <#
        .SYNOPSIS
        Öffnet die Microsoft-Dokumentation des jeweiligen Typen im Browser.
 
        .DESCRIPTION
        Öffnet die Microsoft-Dokumentation des jeweiligen Typen im Browser.
 
        .INPUTS
        System.Object
 
        .OUTPUTS
        System.String
 
        .EXAMPLE
        Get-ChildItem c:\ -Force | Get-TypeDocumentation
 
        .EXAMPLE
        Get-Process | Get-TypeDocumentation
 
        .EXAMPLE
        Get-Service | Get-TypeDocumentation
 
        .EXAMPLE
        1 | Get-TypeDocumentation
    #>

    begin {
        $My = [HashTable]::Synchronized(@{})
        $My.TypeNames = @()
    }
    process {
        $My.TypeNames += $_.GetType().FullName
    }
    end {
        $My.TypeNames | Select-Object -Unique | ForEach-Object -Process {
            $url = 'https://docs.microsoft.com/de-de/dotnet/api/{0}' -f $_
            $_
            Start-Process $url
        }
        Remove-Variable -Name 'My' -Force
    }
}

## 9. Aufräumen
Set-StrictMode -Off
$ErrorActionPreference = $backupErrorActionPreference