Open
Description
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