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

Make Export-FormatData syntax support specifying the output file positionally #6680

Copy link
Copy link
@mklement0

Description

@mklement0
Issue body actions

Related: #6681

Currently, you cannot positionally specify an output file for Export-FormatData, even though it is typically the only (non-switch) parameter, and other export-/file-writing cmdlets you do allow you to specify the target file positionally.

I'd expect all of the following forms to be equivalent:

... | Export-FormatData foo.format.ps1xml  # !! NOT supported: positional out-file argument
... | Export-FormatData -Path foo.format.ps1xml
... | Export-FormatData -LiteralPath foo.format.ps1xml

Also, given that -Path doesn't support wildcards, there's no need for a separate parameter set, and so -Path can simply be made an alias of -LiteralPath. (-Path, perhaps surprisingly, does support wildcard expressions, as long as they resolve to a single file.)

Environment data

Written as of:

PowerShell Core v6.0.2
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or more

    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.