< Back
Register-PSFParameterClassMapping
Post
NAME Register-PSFParameterClassMapping
SYNOPSIS
Registers types to a parameter classes input interpretation.
SYNTAX
Register-PSFParameterClassMapping [-ParameterClass] {Computer | DateTime | TimeSpan | Encoding} [-TypeName]
<String> [-Properties] <String[]> [-EnableException] [<CommonParameters>]
DESCRIPTION
The parameter classes shipped in PSFramework can be extended to support input of an unknown object type.
In order to accomplish that, it is necessary to register the name of that type (and the properties to use) using
this command.
On input interpretation, it will check the TypeNames property on the PSObject for evaluation.
This means you can also specify custom PSObjects by giving them a dedicated name.
PARAMETERS
-ParameterClass
The parameter class to extend.
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-TypeName <String>
The name of the type to register.
Required? true
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Properties <String[]>
The properties to check.
When processing an object of this type, it will try to access the properties in this order, trying to make
something fit the intended result.
The first property that is a fit for the parameter class is chosen, other ones are ignored.
Required? true
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false
-EnableException [<SwitchParameter>]
This parameters disables user-friendly warnings and enables the throwing of exceptions.
This is less user friendly, but allows catching exceptions in calling scripts.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Register-PSFParameterClassMapping -ParameterClass 'Computer' -TypeName
'microsoft.activedirectory.management.adcomputer' -Properties 'DNSHostName', 'Name'
This extends the computer parameter class by ...
- having it accept the type 'microsoft.activedirectory.management.adcomputer'
- having it use the 'DNSHostName' property if available, falling back to 'Name' if necessary
RELATED LINKS
SYNOPSIS
Registers types to a parameter classes input interpretation.
SYNTAX
Register-PSFParameterClassMapping [-ParameterClass] {Computer | DateTime | TimeSpan | Encoding} [-TypeName]
<String> [-Properties] <String[]> [-EnableException] [<CommonParameters>]
DESCRIPTION
The parameter classes shipped in PSFramework can be extended to support input of an unknown object type.
In order to accomplish that, it is necessary to register the name of that type (and the properties to use) using
this command.
On input interpretation, it will check the TypeNames property on the PSObject for evaluation.
This means you can also specify custom PSObjects by giving them a dedicated name.
PARAMETERS
-ParameterClass
The parameter class to extend.
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-TypeName <String>
The name of the type to register.
Required? true
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Properties <String[]>
The properties to check.
When processing an object of this type, it will try to access the properties in this order, trying to make
something fit the intended result.
The first property that is a fit for the parameter class is chosen, other ones are ignored.
Required? true
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false
-EnableException [<SwitchParameter>]
This parameters disables user-friendly warnings and enables the throwing of exceptions.
This is less user friendly, but allows catching exceptions in calling scripts.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Register-PSFParameterClassMapping -ParameterClass 'Computer' -TypeName
'microsoft.activedirectory.management.adcomputer' -Properties 'DNSHostName', 'Name'
This extends the computer parameter class by ...
- having it accept the type 'microsoft.activedirectory.management.adcomputer'
- having it use the 'DNSHostName' property if available, falling back to 'Name' if necessary
RELATED LINKS