Skip to content

Posts from the ‘PowerShell’ Category

4
Aug

Export List of File Names with PowerShell

Here’s a quick and easy little function to get a list of files (and their paths) using PowerShell.

Function GetFileNames([string]$path, [string]$outputFile) {
  $list = Get-ChildItem $path -Recurse
  $list | Select-Object BaseName, FullName | Export-Csv $outputFile
}

GetFileNames ".\" "C:\Output.csv"