Skip to content

Instantly share code, notes, and snippets.

@DCCoder90
Created July 22, 2021 00:25
Show Gist options
  • Save DCCoder90/727b413ed7c51f5bce8f2d947999a15c to your computer and use it in GitHub Desktop.
Save DCCoder90/727b413ed7c51f5bce8f2d947999a15c to your computer and use it in GitHub Desktop.
Combine all CSVs in directory to single CSV
$CSVFolder = 'C:\path\to\directory\with\csvs';
$OutputFile = 'C:\path\to\combined.csv';
$CSV = Get-ChildItem -Path $CSVFolder -Filter *.csv | ForEach-Object {
Import-Csv -Path $_
}
$CSV | Export-Csv -Path $OutputFile -NoTypeInformation -Force;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment