external help file | Module Name | online version | schema |
---|---|---|---|
PSScriptTools-help.xml |
PSScriptTools |
2.0.0 |
Get non-default aliases defined in the current session.
Get-MyAlias [-NoModule] [<CommonParameters>]
Often you might define aliases for functions and scripts you use all of time. It may difficult sometimes to remember them all or to find them in the default Get-Alias output. This command will list all currently defined aliases that are not part of the initial PowerShell state.
The PSScriptTools module also includes a custom formatting file for alias objects which you can use with Get-Alias or Get-MyAlias. See examples.
PS C:\> Get-MyAlias
CommandType Name Version Source
----------- ---- ------- ------
Alias abt -> Get-AboutInfo
Alias bv -> Brave
Alias cal -> Get-Calendar 1.11.0 PSCalendar
Alias cc -> Copy-Command 2.27.0 PSScriptTools
Alias cfn -> New-CustomFileName 2.27.0 PSScriptTools
Alias CFS -> ConvertFrom-String 3.1.0.0 Microsoft.PowerShell.Utility
Alias cft -> ConvertFrom-Text 2.27.0 PSScriptTools
Alias chc -> Convert-HashTableToCode 2.27.0 PSScriptTools
Alias che -> Copy-HelpExample 2.27.0 PSScriptTools
Alias cl -> Create-List
Alias clr -> Convert-EventLogRecord 2.27.0 PSScriptTools
Alias clt -> ConvertTo-LocalTime 2.27.0 PSScriptTools
Alias cmo -> Compare-Module 2.27.0 PSScriptTools
...
Get all aliases that aren't par of the initial session state. This will include aliases defined in any modules you have loaded.
PS C:\> Get-MyAlias -NoModule
CommandType Name Version Source
----------- ---- ------- ------
Alias abt -> Get-AboutInfo
Alias bv -> Brave
Alias cl -> Create-List
Get defined aliases that don't belong to a module. These should be aliases you have defined in stand-alone scripts or your profile.
PS C:\> Get-MyAlias -NoModule | Format-Table -View options
Name Definition Options ModuleName Version
---- ---------- ------- ---------- -------
abt Get-AboutInfo None
bv Brave None
cl Create-List None
np notepad ReadOnly
Get your aliases and pipe to format table using a custom view defined by the PSScriptTools module.
Only show aliases that DO NOT belong to a module.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/