更新时间:2023-08-29 08:46:46
试试这个:
$path = "c:\temp" $out = "c:\temp\output.txt" Get-ChildItem $path -Filter data*.txt | % { $file = $_.Name Get-Content $_.FullName | % { "${file}: $_" | Out-File -Append $out } }
powershell - 连接 N 个文本文件并将文件名添加到每一行