| external help file | PSTypeExtensionTools-help.xml |
|---|---|
| Module Name | PSTypeExtensionTools |
| online version | https://jdhitsolutions.com/yourls/414a1c |
| schema | 2.0.0 |
Get selected type extensions.
Get-PSTypeExtension [-TypeName] <String> [-Members <String[]>] [-CodeProperty] [<CommonParameters>]Use this command to list defined type extensions. You can either select individual ones or all of them. Do not specify any members to retrieve all of them. This command is very similar to Get-TypeData, except that it makes it easier to see the extension value.
By default, CodeProperty members are not displayed because they can't be exported.
PS C:\> Get-PSTypeExtension system.string
TypeName: System.String
Name Type Value
---- ---- -----
Size AliasProperty Length
IsIPAddress ScriptMethod $this -match "^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$"
Reverse ScriptMethod for ($i=$this.length;$i -ge 0;$i--) {...
IsEmail ScriptProperty $this -match '^\S+@([\w-]+)\.(com|edu|org|net)$'
Randomize ScriptMethod ($this.ToCharArray() | get-random -Count $this.length) -join ""Get all type extensions for System.String.
PS C:\> Get-PSTypeExtension System.String -members size
TypeName: System.String
Name Type Value
---- ---- -----
Size AliasProperty LengthGet the Size type extension for System.String.
PS C:\> Get-Process | Get-PSType | Get-PSTypeExtension
TypeName: System.Diagnostics.Process
Name Type Value
---- ---- -----
Name AliasProperty ProcessName
SI AliasProperty SessionId
Handles AliasProperty Handlecount
VM AliasProperty VirtualMemorySize64
WS AliasProperty WorkingSet64
PM AliasProperty PagedMemorySize64
NPM AliasProperty NonpagedSystemMemorySize64
Path ScriptProperty $this.MainModule.FileName
Company ScriptProperty $this.MainModule.FileVersionInfo.CompanyName
CPU ScriptProperty $this.TotalProcessorTime.TotalSeconds
FileVersion ScriptProperty $this.MainModule.FileVersionInfo.FileVersion
ProductVersion ScriptProperty $this.MainModule.FileVersionInfo.ProductVersion
Description ScriptProperty $this.MainModule.FileVersionInfo.FileDescription
Product ScriptProperty $this.MainModule.FileVersionInfo.ProductName
__NounName NoteProperty ProcessDiscover type extensions for a given type of object.
PS C:\> Get-PSTypeExtension System.IO.FileInfo -CodeProperty |
Select-Object MemberName,MemberType
MemberName MemberType
---------- ----------
Size AliasProperty
Modified AliasProperty
Created AliasProperty
Mode CodeProperty
ModeWithoutHardLink CodeProperty
Target CodeProperty
LinkType CodeProperty
NameString CodeProperty
LengthString CodeProperty
LastWriteTimeString CodeProperty
VersionInfo ScriptProperty
BaseName ScriptProperty
SizeKB ScriptProperty
SizeMB ScriptPropertyDisplay all extensions, including CodeProperty, and display the member name and type.
Enter a comma-separated list of member names.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseEnter the name of a type like System.IO.FileInfo. You should have tab-completion for types found with Get-TypeData.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: FalseShow CodeProperty custom properties
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
This command has an alias of gtex.
Learn more about PowerShell: http://jdhitsolutions.com/yourls/newsletter