When one PowerShell command sends objects to another, the receiving command must place each object on a parameter. Pipeline parameter binding is the process PowerShell uses to make that connection. If ByValue cannot bind the object itself, PowerShell tries ByPropertyName: it looks for input-object properties whose names match command-parameter names. section 10.2 section 10.3
Use this quick method to check whether property-name binding will work:
- Inspect the input objects with Get-Member and note their property names. section 10.4
- Inspect the receiving command's full help and find parameters marked “Accept pipeline input: True (ByPropertyName).” section 10.4 section 15.3
- Match spelling exactly: a property named Name can bind to a parameter named -Name. section 10.4
- Remember that every matching property and eligible parameter may bind, not just one pair. section 10.4
- Check the values as well as the names; a successful name match can still pass unusable data. section 10.4
Renaming imported data for New-ADUser
An HR CSV might contain login and dept instead of the properties required by New-ADUser. Add calculated properties, then pipe the corrected objects onward: Import-Csv .\newusers.csv | Select-Object -Property *, @{Name='samAccountName'; Expression={$_.login}}, @{Name='Name'; Expression={$_.login}}, @{Name='Department'; Expression={$_.Dept}} | New-ADUser Select-Object preserves the existing properties and adds names that match New-ADUser parameters. This replaces repeated manual CSV editing with a repeatable transformation. section 10.5

