Skip to content

Proper use of the pipeline with cmdlets #214

Open
@jrich523

Description

@jrich523

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions