◐ Shell
clean mode source ↗

Make Export-Csv -Append and -NoHeader mutually exclusive by yotsuda · Pull Request #26472 · PowerShell/PowerShell

…exclusive

- Add validation in ExportCsvCommand.BeginProcessing() to throw an error
  when both -Append and -NoHeader parameters are specified together
- Add error message resource: CannotSpecifyAppendAndNoHeader
- Add Pester test to verify the error is thrown correctly

This prevents undefined behavior when users attempt to append to a CSV
file without headers, which could result in data corruption or confusion.

@yotsuda yotsuda changed the title Fix #25820: Make Export-Csv -Append and -NoHeader mutually exclusive Make Export-Csv -Append and -NoHeader mutually exclusive

Nov 18, 2025

@iSazonov iSazonov added the CL-General

Indicates that a PR should be marked as a general cmdlet change in the Change Log

label

Nov 18, 2025

iSazonov

@yotsuda

@yotsuda yotsuda marked this pull request as ready for review

November 18, 2025 05:16

iSazonov

…Commands.cs

Co-authored-by: Ilya <darpa@yandex.ru>

iSazonov

…Strings.resx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

iSazonov

@yotsuda yotsuda deleted the fix/export-csv-validation branch

November 22, 2025 08:01

SIRMARGIN pushed a commit to SIRMARGIN/PowerShell that referenced this pull request

Dec 12, 2025

kilasuit pushed a commit to kilasuit/PowerShell that referenced this pull request

Jan 2, 2026

JustinGrote pushed a commit to JustinGrote/PowerShell that referenced this pull request

Jun 2, 2026