about_Type_Accelerators

Kurzbeschreibung

Beschreibt die Typbeschleuniger, die für .NET-Typen verfügbar sind.

Lange Beschreibung

Typbeschleuniger sind Aliase für .NET-Typen. Sie ermöglichen den Zugriff auf bestimmte .NET-Typen, ohne explizit den vollständigen Typnamen zu verwenden. Sie können z. B. [System.Management.Automation.AliasAttribute] auf [Alias] kürzen.

Typbeschleunigernamen werden meist kleingeschrieben, aber einige werden mit der Pascal-Schreibweise definiert. Bei PowerShell wird die Groß-/Kleinschreibung nicht beachtet, sodass Sie beide Schreibweisen verwenden können.

Verwenden von Zugriffstasten

Bei den meisten Typbeschleunigern verwenden Sie diese auf die gleiche Weise, wie Sie den vollständigen Typnamen verwenden würden. PowerShell verfügt jedoch über eine spezielle Behandlung für die folgenden beiden Typbeschleuniger:

Typbeschleuniger werden am häufigsten zur Angabe des Variablentyps oder zum Umwandeln eines Objekts in einen bestimmten Typ verwendet. In diesen Fällen müssen Sie den Typnamen oder seinen Beschleuniger in eckige Klammern ([]) einschließen. Zum Beispiel: [int] oder [int32].

In einigen Kontexten können Sie den Type-Accelerator-Namen als Zeichenfolge angeben. Zum Beispiel:

  • Bei Verwendung mit Typvergleichsoperatoren

    PS> '1' -as 'int'
    1
    PS> 1 -is 'int'
    True
    
  • Bei Verwendung mit [type]-Typklasse

    PS> [type]'int'
    
    IsPublic IsSerial Name                                     BaseType
    -------- -------- ----                                     --------
    True     True     Int32                                    System.ValueType
    

In anderen Kontexten, wie bei der Reflexion, müssen Sie den vollständigen Typnamen als Zeichenfolge anstelle des Typbeschleunigernamens verwenden.

Standardtypinfos

Beschleunigername Vollständiger Typname
adsi System.DirectoryServices.DirectoryEntry
adsisearcher System.DirectoryServices.DirectorySearcher
Alias System.Management.Automation.AliasAttribute
AllowEmptyCollection System.Management.Automation.AllowEmptyCollectionAttribute
AllowEmptyString System.Management.Automation.AllowEmptyStringAttribute
AllowNull System.Management.Automation.AllowNullAttribute
ArgumentVervollständigen System.Management.Automation.ArgumentCompleterAttribute
ArgumentCompletions System.Management.Automation.ArgumentCompletionsAttribute
array System.Array
bigint System.Numerics.BigInteger
bool System.Boolean
Byte System.Byte
char System.Char
cimclass Microsoft.Management.Infrastructure.CimClass
cimconverter Microsoft.Management.Infrastructure.CimConverter
ciminstance Microsoft.Management.Infrastructure.CimInstance
CimSession Microsoft.Management.Infrastructure.CimSession
cimtype Microsoft.Management.Infrastructure.CimType
CmdletBinding System.Management.Automation.CmdletBindingAttribute
cultureinfo System.Globalization.CultureInfo
datetime System.DateTime
Decimal System.Decimal
double System.Double
DscLocalConfigurationManager System.Management.Automation.DscLocalConfigurationManagerAttribute
DscProperty System.Management.Automation.DscPropertyAttribute
DscResource System.Management.Automation.DscResourceAttribute
ExperimentAction System.Management.Automation.ExperimentAction
Experimentell System.Management.Automation.ExperimentalAttribute
ExperimentalFeature System.Management.Automation.ExperimentalFeature
float System.Single
guid System.Guid
Hashtabelle System.Collections.Hashtable
initialsessionstate System.Management.Automation.Runspaces.InitialSessionState
int System.Int32
int16 System.Int16
int32 System.Int32
int64 System.Int64
ipaddress System.Net.IPAddress
IPEndpoint System.Net.IPEndPoint
long System.Int64
mailaddress System.Net.Mail.MailAddress
NoRunspaceAffinity System.Management.Automation.Language.NoRunspaceAffinityAttribute
NullString System.Management.Automation.Language.NullString
ObjectSecurity System.Security.AccessControl.ObjectSecurity
geordnete System.Collections.Specialized.OrderedDictionary
OutputType System.Management.Automation.OutputTypeAttribute
Parameter System.Management.Automation.ParameterAttribute
PhysischeAdresse System.Net.NetworkInformation.PhysicalAddress
powershell System.Management.Automation.PowerShell
psaliasproperty System.Management.Automation.PSAliasProperty
pscredential System.Management.Automation.PSCredential
pscustomobject System.Management.Automation.PSObject
PSDefaultValue System.Management.Automation.PSDefaultValueAttribute
pslistmodifier System.Management.Automation.PSListModifier
psmoduleinfo System.Management.Automation.PSModuleInfo
psnoteproperty System.Management.Automation.PSNoteProperty
psobject System.Management.Automation.PSObject
psprimitivedictionary System.Management.Automation.PSPrimitiveDictionary
pspropertyexpression Microsoft.PowerShell.Commands.PSPropertyExpression
psscriptmethod System.Management.Automation.PSScriptMethod
psscriptproperty System.Management.Automation.PSScriptProperty
PSTypeNameAttribute System.Management.Automation.PSTypeNameAttribute
psvariable System.Management.Automation.PSVariable
psvariableproperty System.Management.Automation.PSVariableProperty
ref System.Management.Automation.PSReference
regex System.Text.RegularExpressions.Regex
Runspace System.Management.Automation.Runspaces.Runspace
Runspacefactory System.Management.Automation.Runspaces.RunspaceFactory
sbyte System.SByte
scriptblock System.Management.Automation.ScriptBlock
securestring System.Security.SecureString
semver System.Management.Automation.SemanticVersion
short System.Int16
single System.Single
Zeichenfolge System.String
SupportsWildcards System.Management.Automation.SupportsWildcardsAttribute
switch System.Management.Automation.SwitchParameter
Zeitraum System.TimeSpan
Typ System.Type
uint System.UInt32
uint16 System.UInt16
uint32 System.UInt32
uint64 System.UInt64
ulong System.UInt64
uri System.Uri
ushort System.UInt16
ValidateCount System.Management.Automation.ValidateCountAttribute
ValidateDrive System.Management.Automation.ValidateDriveAttribute
ValidateLength System.Management.Automation.ValidateLengthAttribute
ValidateNotNull System.Management.Automation.ValidateNotNullAttribute
ValidateNotNullOrEmpty System.Management.Automation.ValidateNotNullOrEmptyAttribute
ValidateNotNullOrWhiteSpace System.Management.Automation.ValidateNotNullOrWhiteSpaceAttribute
ValidatePattern System.Management.Automation.ValidatePatternAttribute
ValidateRange System.Management.Automation.ValidateRangeAttribute
ValidateScript System.Management.Automation.ValidateScriptAttribute
ValidateSet System.Management.Automation.ValidateSetAttribute
ValidateTrustedData System.Management.Automation.ValidateTrustedDataAttribute
ValidateUserDrive System.Management.Automation.ValidateUserDriveAttribute
version System.Version
void System.Void
WildcardPattern System.Management.Automation.WildcardPattern
wmi System.Management.ManagementObject
wmiclass System.Management.ManagementClass
wmisearcher System.Management.ManagementObjectSearcher
X500DistinguishedName System.Security.Cryptography.X509Certificates.X500DistinguishedName
X509Certificate System.Security.Cryptography.X509Certificates.X509Certificate
xml System.Xml.XmlDocument