Last active
August 15, 2020 04:34
-
-
Save eat-sleep-code/792d7de9e80e6416dbded4612e638fa5 to your computer and use it in GitHub Desktop.
PowerShell script to write out a list of files in a directory
This file contains 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
$input = 'C:\input'; | |
$output = 'C:\file-list.txt'; | |
$files = Get-ChildItem $input -Recurse; | |
foreach ($file in $files){ | |
$fullName = $file.FullName; | |
$lastWriteTime = $file.LastWriteTime; | |
Write-Output "$fullName`t$lastWriteTime" | Out-File -FilePath $output -Append | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment