Skip to content

Instantly share code, notes, and snippets.

@vermaakarsh
Last active October 8, 2021 21:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vermaakarsh/1e169cd5a148a7618fd8f8465ac79a89 to your computer and use it in GitHub Desktop.
Save vermaakarsh/1e169cd5a148a7618fd8f8465ac79a89 to your computer and use it in GitHub Desktop.
Export List of File Names with PowerShell
# This is just a copy-paste of the function by Mattn hanson. keeping a copy for my reference
# Original Post - http://www.matthanson.ca/2009/08/export-list-of-file-names-with-powershell/comment-page-1/
Function GetFileNames([string]$path, [string]$outputFile) {
$list = Get-ChildItem $path -Recurse
$list | Select-Object BaseName, FullName | Export-Csv $outputFile
}
GetFileNames ".\" "C:\Output.csv"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment