Last active
September 24, 2018 15:56
-
-
Save statgeek/1fc0a8717dd1c07d0af9066a99857342 to your computer and use it in GitHub Desktop.
List all files in folders and export to a CSV file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| Description | |
| A script for finding files in a directory and writing the list out to a CSV file | |
| Modified from this one | |
| #> | |
| Write-Host "Enter Root Directory you would like to search" | |
| Write-Host "" | |
| Write-Host "Example: C:\Users\testuser" | |
| Write-Host "" | |
| $directory = Read-Host ">>" | |
| cls | |
| Write-Host "Enter where you would like the CSV file to be exported" | |
| Write-Host "" | |
| Write-Host "Example: C:\Files.csv" | |
| Write-Host "" | |
| $outPutFile = Read-Host '>>' | |
| cls | |
| Get-ChildItem -path $directory -Recurse | select fullname, *time, length | Export-CSV -Path $outPutFile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment