PowerShellコマンドレット虎の巻

Expand-Archive

Expand-Archiveは、zip形式ファイルを解凍するコマンドです。

エイリアスなし

解説

zip形式ファイルを解凍する時に使用します。

構文

(構文)
Expand-Archive [-Path] <string> [[-DestinationPath] <string>] [<CommonParameters>] Expand-Archive [[-DestinationPath] <string>] [<CommonParameters>]
【主要パラメータ】
パラメータ説明
-Path パス対象パスを指定する(ワイルドカード使用可)
(例)-Path "D:\test*"
-LiteralPath パス対象パスを指定する(ワイルドカード使用不可)
(例)-LiteralPath "D:\test"
-DestinationPath パス解凍先のパスを指定する
-Force強制的に実行する
-WhatIf実行はせずに実行結果の確認のみ行う
-Confirm実行前に確認メッセージの表示を行う

共通的なパラメータは「共通パラメータ」をご覧ください。

サンプル

C:\test.zipをC:\hogeに解凍する

Expand-Archive -Path C:\test.zip -DestinationPath C:\hoge

解凍前に確認メッセージを表示する

Expand-Archive -Path C:\test.zip -DestinationPath C:\hoge -Confirm

コマンドのヘルプを表示する

Get-Help Expand-Archive

備考

  • パラメータ名の「-Path」、「-DestinationPath」は省略可能です。

関連項目