Problem: 1) "$FileName" in string, 2) recording 7000+ files took over an hour. How do I make the recording faster?
Get-ChildItem "C:\*.csv" | ForEach-Object {
$CSV = Import-CSV -Path $_.FullName
$FileName = $_.Name
$CSV | Select-Object *,@{N='Filename';E={$FileName}} | Export-CSV $_.FullName
}