Skip to content

Instantly share code, notes, and snippets.

@KozzyKoder
Created October 19, 2015 14:22
Show Gist options
  • Save KozzyKoder/cbf0cb7013913f6fa975 to your computer and use it in GitHub Desktop.
Save KozzyKoder/cbf0cb7013913f6fa975 to your computer and use it in GitHub Desktop.
$combined_path = Join-Path (Get-Item -Path ".\" -Verbose).FullName COMBINED.sql;
get-childitem | where {$_.extension -eq ".sql"} | Sort-Object $ToNatural | ForEach-Object { Add-Content $combined_path ("SELECT '" + $_.name + "';`n") -Encoding UTF8; Get-Content $_ | Add-Content $combined_path -Encoding UTF8; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment