Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Common -Splat parameter #25574

Copy link
Copy link
@iRon7

Description

@iRon7
Issue body actions

Summary of the new feature / enhancement

The proposal for inline splatting has been rejected some time ago.

See: #25029:

This was first proposed a long time ago:

Rejected RFC: https://github.com/PowerShell/PowerShell-RFC/blob/master/Archive/Draft/RFC0002-Generalized-Splatting.md

Related discussion: PowerShell/PowerShell-RFC#6
A related PR that was therefore ultimately not accepted: #10073

As far I understand the issue behind the rejection: the discussion was meanly focused on an operator that could pass an unnamed argument which would require a semantic sugar in the engine that might conflict with other syntaxes or initiate a break change.
If the splatting could be done by means of a common named parameter (e.g. -Splat [Object[]]), the impact on the enige would be less and I guess easier to implement, while this would be more PowerShell compliant and support inline usage:

Wishful thinking:

New-AzVm -Splat @{
    Name = $Name
    Location = "West US"
    ResourceGroupName = "myResourceGroup"
    VirtualNetworkName = "myVnet"
    SubnetName = "mySubnet"
    SecurityGroupName = "myNetworkSecurityGroup"
    PublicIpAddressName = "myPublicIpAddress"
}

Proposed technical implementation details (optional)

No response

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.