Skip to content

Instantly share code, notes, and snippets.

@gpresland
Last active August 23, 2019 20:13
Show Gist options
  • Save gpresland/a0eb8b835daacebc606e3640e98024f9 to your computer and use it in GitHub Desktop.
Save gpresland/a0eb8b835daacebc606e3640e98024f9 to your computer and use it in GitHub Desktop.
PowerShell Snippets
# Get parent directory of script being executes
$base_dir = Split-Path -Parent $PSScriptRoot
# Delete contents of a folder.
Get-ChildItem <folder> -Recurse -Force | Remove-Item
# Concatenate files.
# See https://stackoverflow.com/a/53079166/779957
# Exmaple 1
type file1.csv file2.csv > concat.csv
# Example 2
type *.csv > concat.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment