Skip to content

Document -Delimiter & -NoTrailingDelimiter parameters for Set-Content/Add-Content cmdlets #11567

Open
@ArmaanMcleod

Description

@ArmaanMcleod

Prerequisites

  • Existing Issue: Search the existing issues for this repository. If there is an issue that fits your needs do not file a new one. Subscribe, react, or comment on that issue instead.
  • Descriptive Title: Write the title for this issue as a short synopsis. If possible, provide context. For example, "Document new Get-Foo cmdlet" instead of "New cmdlet."

Summary

Added new parameters to Set-Content/Add-Content cmdlets so a user can specify their own delimiters when writing to files.

We will need to document new parameters -Delimiter and -NoTrailingDelimiter parameters to show new behaviour.

Details

Example 1

Write contents to file using delimiters:

> "a", "b", "c" | Set-Content -Path test.txt -Delimiter ","
> cat ./test.txt
a,b,c,

Example 2

Write contents to file using comma delimiter and remove trailing delimiter:

> "a", "b", "c" | Set-Content -Path test.txt -Delimiter "," -NoTrailingDelimiter
> cat ./test.txt
a,b,c

Articles

  • reference/7.5/Microsoft.PowerShell.Management/Set-Content.md
  • reference/7.5/Microsoft.PowerShell.Management/Add-Content.md

Related Source Pull Requests

Related Source Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions