Werbung

Herkunft

Kurzinformation

Gets the types that are currenty loaded in .NET,
or gets information about a specific type

Syntax

<# .Synopsis Gets the types that are currenty loaded in .NET, or gets information about a specific type .Description Gets all of the loaded types, or gets the possible values for an enumerated type or value. .Example # Gets all loaded types Get-Type .Example # Gets types from System.Management.Automation Get-Type -Assembly ([PSObject].Assembly) .Example # Gets all of the possible values for the ApartmentState property [Threading.Thread]::CurrentThread.ApartmentState | Get-Type .Example # Gets all of the possible values for an apartmentstate [Threading.ApartmentState] | Get-Type #> [CmdletBinding(DefaultParameterSetName="Assembly")] param( # The assembly to collect types from [Parameter(ParameterSetName="Assembly", ValueFromPipeline=$true)] [Reflection.Assembly[]] $Assembly, # The enumerated value to get all of the possibilties of [Parameter(ParameterSetName="Enum", ValueFromPipeline=$true)] [Enum] $Enum, # Returns possible values if the Type was an enumerated value # Otherwise, returns the static members of the type [Parameter(ParameterSetName="Type", ValueFromPipeline=$true)] [Type[]] $Type ) process { switch ($psCmdlet.ParameterSetName) { Assembly { if (! $psBoundParameters.Count -and ! $args.Count) { $Assembly = [AppDomain]::CurrentDomain.GetAssemblies() } foreach ($asm in $assembly) { if ($asm) { $asm.GetTypes() } } } Type { foreach ($t in $type) { if ($t.IsEnum) { [Enum]::GetValues($t) } else { $t | Get-Member -static } } } Enum { [Enum]::GetValues($enum.GetType()) } } }

Beschreibung

Gets all of the loaded types, or gets the possible values for an enumerated type or value.

Links

Liste aller Commandlets Mehr über die Windows PowerShell

Bücher zur PowerShell

Buchcover Windows PowerShell 5.0 - Das Praxishandbuch (1. Auflage 2016/5. Auflage Gesamtreihe) Windows PowerShell 5.0 - Das Praxishandbuch (1. Auflage 2016/5. Auflage Gesamtreihe)
Autoren: Dr. Holger Schwichtenberg
erschienen 2016, 996 Seiten, 49,99 €
ISBN: 3446446435
Bestellung: Amazon.de oder im Buchhandel über ISBN 3446446435

Schulungen/Seminare

Offene Seminare zur PowerShell
In-House-Seminare zur PowerShell