前言
PowerShell压缩和解压缩zip文件
压缩为zip文件
<dir_or_file>:被压缩的文件或目录
<file>.zip:压缩后的压缩文件存放路径
-Confirm:压缩前确认
1
| Compress-Archive -Path "<dir_or_file>" -DestinationPath "<file>.zip"
|
解压缩zip文件
<file>.zip:被解压缩的文件
<dir>:解压后的存放路径
-Confirm:解压前确认
1
| Expand-Archive -Path "<file>.zip" -DestinationPath "<dir>"
|
完成
参考文献
博客园——重庆熊猫
微软官方文档