-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proper use of the pipeline with cmdlets #214
Comments
Refer about_Pipelines. Needs review with the team. |
@ashishdhingra thank you for looking at this. As time has gone on i've noticed that this seems to happen with other aws cmdlets. I think it should be a safe assumption that if there is a |
I'll also add that its very common to use a param of
You could add this support without having to do anything too crazy or break backwards compatibility. You can use the cmdlet info to poke around at it
you'd create the |
Thanks to the original submitter for adding this item. I brought this up in this discussion QA essentially: #285 Having to map 66 distinct properties just to have high confidence I'm updating my cloudfront distribution to be consistent with its existing state is just wild. |
Yes, much of the "power" of PowerShell comes from the pipeline. VMware.PowerCLI is a good example of a set of modules that treats the pipeline properly most of the time. AWS.Tools needs a lot of work in this area. Almost every cmdlet should accept pipeline input. Get verb cmdlets should accept strings of ARNs, for example. Set/Remove/Update/etc. should accept the output of the corresponding Get. |
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 nameThe text was updated successfully, but these errors were encountered: