Compress-Archive
安全ZIP圧縮(PS標準)
Compress-Archive -Path <src> -DestinationPath out.zip
追加ツール不要でZIP作成。ログ一式の回収やバックアップの定番。-Updateで既存ZIPへ追加。
実行例
Compress-Archive -Path C:\logs\* -DestinationPath logs.zipログをまとめてZIP化
書式
Compress-Archive -Path <src> -DestinationPath <zip> [-Update]
実行前の注意
作成のみ。
関連コマンド
- Expand-ArchiveZIP展開(PS標準)
- zipZIP圧縮