有没有办法使用压缩存档脚本,当从路径运行时:
我很难让它同时完成这三件事。
编辑:
以下过滤和递归,但不维护文件夹结构
Get-ChildItem -Path ".\" -Filter "*.docx" -Recurse |
Compress-Archive -CompressionLevel Optimal -DestinationPath "$pwd\doc.archive-$(Get-Date -f yyyyMMdd.hhmmss).zip"
Run Code Online (Sandbox Code Playgroud)
此项不递归:
Compress-Archive -Path "$pwd\*.docx" -CompressionLevel Optimal -DestinationPath "$pwd\doc.archive-$(Get-Date -f yyyyMMdd.hhmmss).zip"
Run Code Online (Sandbox Code Playgroud)
在某些时候,我有一个命令会递归但不会过滤,但现在无法返回。