Home Dashboard Directory Help
Search

Add support for splatting collections that are stored as a property of an object by Kirk Munro


Status: 

Active


3
0
Sign in
to vote
Type: Suggestion
ID: 778964
Opened: 2/11/2013 7:21:04 AM
Access Restriction: Public
0
Workaround(s)
view

Description

PowerShell should allow users to splat collections that are stored in a property of an object. For example, you can splat PSBoundParameters like this:

Test-Something @PSBoundParameters

You should also be able to splat PSBoundParameters like this:

Test-Something @PSCmdlet.MyInvocation.BoundParameters

This leverages the @ symbol to indicate something is being splatted, but adds support for dereferencing objects in the process.

This feature would make for much simpler splatting logic, especially if implemented at the same time as this request:

https://connect.microsoft.com/PowerShell/feedback/details/778931/fault-tolerant-splatting#details
Details
Sign in to post a comment.
Sign in to post a workaround.