Skip to content

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

@mklement0

Description

@mklement0

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

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions