![見出し画像](https://assets.st-note.com/production/uploads/images/118899392/rectangle_large_type_2_781166a6c746fdf96f5af291418c4921.png?width=1200)
PowerShell ZIPファイル圧縮解凍
PowerShellでZIPファイルの圧縮をするにはCompress-Archive、
解凍にはExpand-Archiveを使います
例えば、test.txtファイルを test.zip に圧縮する場合
Compress-Archive -Path test.txt -DestinationPath test.zip
後ろに-Forceパラメータを付けると同じZIPファイルがある場合は上書き保存します。
Compress-Archive -Path hoge1.pptx -DestinationPath hoge1.zip -Force
test.zip を C:\temp に解答する場合
Expand-Archive -Path test.zip -DestinationPath C:\temp\
圧縮と同じで後ろに -Forceを付けると強制上書きになります
#PowerShell #プログラミング学習 #プログラミング #ZIP #圧縮解凍 #Windows #コマンドレット