因此,我尝试将文件处理为单独的备份文件,但是这会将一个名为数组中最后一个文件的存档。我不确定我在这里缺少什么。
$process = "C:\Program Files (x86)\7-Zip\7z.exe"
$destinationdir = "M:\WIP\OUT\"
$sourcedir = "M:\WIP\ZIP\"
$password = "password"
$ziplist = get-childitem $sourcedir
foreach ($zip in $ziplist)
{$destinationfile= $zip+".zip"
Start-Process $process -ArgumentList "a $destinationfile $zip -o$destinationdir -p$password"-NoNewWindow -Wait
}
答案 0 :(得分:0)
更改
$destinationfile= $zip+".zip"
到
$destinationfile= $zip.FullName+".zip"