How to loop all files in powershell to zip every file to its old name

خرید بک لینک

I'm trying to zip every file in a directory but I can't seem to get it to use the directory or the old file name. It needs to delete the old file so that it's protected in the zip file.

This is what I came up with so far:

$files = Get-ChildItem "D:Backuptestinput*" | 
ForEach ($filename in $files) { 
    $content = Get-Content $_.FullName
    & "C:Program FilesWinRARRar.exe" a -m0 -hps8Cs7y7RfLjYgYb -k -df $filename.rar
    }

Recent Questions...

ما را در سایت Recent Questions دنبال می‌کنید

برچسب: نویسنده: استخدام کار بازدید: 264 تاريخ: چهارشنبه 13 مرداد 1395 ساعت: 15:05

صفحه بندی