Skip to content

Instantly share code, notes, and snippets.

@JacobJohansen
Created July 13, 2020 15:43
Show Gist options
  • Save JacobJohansen/7da4090cd877ca939dd51564316d5b87 to your computer and use it in GitHub Desktop.
Save JacobJohansen/7da4090cd877ca939dd51564316d5b87 to your computer and use it in GitHub Desktop.
get a list of file names only from directory and all subdirectories
. {(cmd /c "dir /o:n /b /s")} | out-string -stream | Select-String -Pattern ".*\..*" | out-string -stream | %{ $_.Split('\')[-1] } > cleanedFilename.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment