February 2019
Intermediate to advanced
626 pages
15h 51m
English
We have not looked at parameter aliases yet. Any parameter may be given one or more aliases using the Alias attribute, as shown in the following example:
function Get-InputObject { [CmdletBinding()] param ( [Parameter(ValueFromPipelineByPropertyName)] [Alias('First', 'Second', 'Third')] $InputObject )}
The alias name is considered when determining whether a property on an input object is suitable to fill a parameter when filling a parameter by property name.
One of the more common uses of this is to provide support for a Path parameter via a pipeline from Get-Item or Get-ChildItem. For example, the following pattern might be used to expose a Path parameter. This is used in the short helper ...
Read now
Unlock full access