【发布时间】:2022-11-15 12:40:33
【问题描述】:
我正在努力使用带有 winrar 的 PowerShell 命令存档文件
文件夹中有一些文本文件N:\Download: abc.txt, xyz.txt
我想得到输出:N:\Download: abc.rar, xyz.rar 并在存档后删除文本文件。
以及如何设置最大压缩级别?
https://documentation.help/WinRAR/HELPSwM.htm
这是我的示例脚本
$Source = get-ChildItem -path N:\Download -filter "*.txt"
$Rarfile = "C:\Program Files\WinRAR\WinRAR.exe"
$Dest = "N:\Download"
&$WinRar a $Source.Fullname $Dest
【问题讨论】:
标签: powershell winrar