我已经有一个循环,列出了 FTP 目录中的文件摘要。$outputBuffer 包含
/archive/20120806_141250.txt
/archive/20120806_142114.txt
/archive/20120807_090149.txt
/archive/20120808_090348.txt
我有一个 For-EachObject 用完整的 ftp 地址替换 /archive:
$outputBuffer | Foreach-Object {
$_ -replace 'archive/', 'ftp://ftp.test.com/outbound/archive/'
}
我的结果是:
ftp://test.com/outbound/archive/20120806_141250.txt
ftp://test.com/outbound/archive/20120806_142114.txt
ftp://test.com/outbound/archive/20120807_090149.txt
ftp://test.com/outbound/archive/20120808_090348.txt
替换后,如何在此 ForEach-Object 语句中添加一行以下载每个文件?