aws / aws/aws-tools-for-powershell
Proper use of the pipeline with cmdlets
- Dominant language
- C#
- Stars
- 298
- Forks
- 102
- Avg merge
- 7d 17m
- Merged PRs (30d)
- 2
Description
If you attempt to do this
`Get-EC2Address | ? { -not $_.associationid } | Remove-EC2Address`
You'll get the error: Remove-EC2Address: You may specify a public IP or allocation id, but not both in the same call.
Typically with powershell to solve this you'd give the cmdlet an `inputobject` param which it typed to the object, and allows pipeline input, which would end up binding the object to the param, and not to the params that are by property name
Contributor guide
Research direction
Start by reproducing the Get-EC2Address | ? { -not $_.associationid } | Remove-EC2Address pipeline and inspect how Remove-EC2Address binds pipeline input. Done means the object is accepted through the inputobject-style binding without also binding both the public IP and allocation ID.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, powershell
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100