ParameterAttribute.ValueFromPipelineByPropertyName Property
Gets and sets a Boolean value that indicates that the parameter can take values from a property of the incoming pipeline object that has the same name as this parameter. For example, if the name of the cmdlet or function parameter is userName, the parameter can take values from the userName property of incoming objects.
Namespace: System.Management.Automation
Assembly: System.Management.Automation (in System.Management.Automation.dll)
Namespace: System.Management.Automation
Assembly: System.Management.Automation (in System.Management.Automation.dll)
/** @property */ public boolean get_ValueFromPipelineByPropertyName () /** @property */ public void set_ValueFromPipelineByPropertyName (boolean value)
public function get ValueFromPipelineByPropertyName () : boolean public function set ValueFromPipelineByPropertyName (value : boolean)
Property Value
A Boolean value that indicates true if the parameter can be filled from a property of the incoming pipeline object that has the same name as this parameter. false indicates that the parameter cannot be filled from the incoming pipeline object property with the same name. The default is false .This example shows how the Parameter attribute is used to declare a parameter that accepts input from a property of the incoming pipeline object that has the same name as this parameter.
[Parameter(ValueFromPipelineByPropertyName = true)] public string ComputerName { get { return computerName; } set { computerName = value; } } private string computerName;
This property is an optional Named parameter of the Parameter attribute. For more information about the declaration syntax that is used to specify the Parameter attribute for cmdlets, see ParameterAttribute Declaration.
Any public static (
Shared
in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Target Platforms
Windows Developer Preview, Windows Server Developer PreviewSend comments about this topic to Microsoft.