見出し画像

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 #コマンドレット


この記事が気に入ったらサポートをしてみませんか?