是否可以使用 PowerShell 创建 zip 存档?
最佳答案
PowerShell v5.0 添加 Compress-Archive
和 Expand-Archive
cmdlet。链接的页面有完整的示例,但其要点是:
# Create a zip file with the contents of C:\Stuff\
Compress-Archive -Path C:\Stuff -DestinationPath archive.zip
# Add more files to the zip file
# (Existing files in the zip file with the same name are replaced)
Compress-Archive -Path C:\OtherStuff\*.txt -Update -DestinationPath archive.zip
# Extract the zip file to C:\Destination\
Expand-Archive -Path archive.zip -DestinationPath C:\Destination
关于powershell - 如何使用 PowerShell 创建 zip 存档?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1153126/