PDFファイルを取得し、このPDFファイルをソースから宛先にコピーする必要があります。PDF名はtxtファイルlistspecに1行ずつあります:
100
200
204
79002
XS002
.pdf
拡張子を連結します
ただし、pdf ファイルは 001 00 .pdf、002 00 .pdf、204 00 .pdf、79002.pdf、XS002.pdf です。最大5つの位置でpdfファイル名を0にしてパッドレフトする必要があります。
私はこのコマンドを使用します:
Get-Content $listspec | Foreach-Object{copy-item -Path $source\$_".pdf".PadLeft(5,'0'), -destination $destination -ErrorAction SilentlyContinue -ErrorVariable +errors}
次のエラーが表示されます。
*Copy-Item : Cannot convert 'System.Object[]' to the type 'System.String' required by parameter ' method is not supported.*
ご協力いただきありがとうございます。