Repository navigation
Make Export-FormatData syntax support specifying the output file positionally #6680
Description
Activity
Also, given that -Path doesn't support wildcards,
Umm - it most definitely supports wildcards, as in:
Get-FormatData | Export-FormatData -Path b*r.*mklement0 commented
on Apr 24, 2018 ContributorAuthorMore actionsAh, indeed. I got confused, because in my test command the wildcard resolved to multiple matches.
And that brings us to the larger point:
Output-file creating cmdlets shouldn't support wildcards for their output file-path parameter.
I'll open a separate issue for that.
mklement0 commented
on Apr 24, 2018 ContributorAuthorMore actionsSpoke too soon: the part about how
Export-FormatDatashould support a positional output file-path argument still applies in this specific case, so I'm reopening this with the wildcard-related part crossed out.mklement0 commented
on Apr 24, 2018 ContributorAuthorMore actionsRe not permitting wildcard expressions with
-Path- please see #6714microsoft-github-policy-service commented
on Nov 16, 2023 ContributorMore actionsThis issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commented
on Nov 16, 2023 ContributorMore actionsThis issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
- addedResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or more
on Nov 16, 2023 microsoft-github-policy-service commented
on Nov 16, 2023 ContributorMore actionsThis issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commented
on Nov 23, 2023 ContributorMore actionsThis issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.
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:
Also, given that(-Pathdoesn't support wildcards, there's no need for a separate parameter set, and so-Pathcan 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