-Recurse recurses through folders.. and write to Out_Headers.txt
Get-ChildItem -Path . -Recurse -Filter '*.csv' |
ForEach{
$PSItem |
Select-Object -Property FullName,
@{Name = 'FirstLineOfFile';Expression = {Get-Content -Path $PSItem.FullName -First 1}}
} |Out-File Out_Headers.txt -Append
No comments:
Post a Comment