powershell打包zip

Compress-Archive -LiteralPath a.txt,b.txt -DestinationPath a.zip #仅打包文件,忽略路径
Compress-Archive -Path a -DestinationPath a.zip
Compress-Archive -Path a\*.txt -DestinationPath a.zip

参考:
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.archive/compress-archive?view=powershell-7.3

发表回复