Expand-Archive (PowerShell 5+)

Extract files from an archive (zipped) file.

      Expand-Archive [-Path] String [-DestinationPath] String [-Force]
            [-Confirm] [-WhatIf] [CommonParameters]

      Expand-Archive [-DestinationPath] String -LiteralPath String [-Force]
            [-Confirm] [-WhatIf] [CommonParameters]

   -DestinationPath String
       The path to the folder in which you want to save the extracted files.

   -LiteralPath String[]
       The path to an archive file..
       Unlike the -Path parameter, the value of -LiteralPath is used exactly as it is typed.
       No characters are interpreted as wildcards. If the path includes escape characters,
       enclose each escape character in single quotation marks, to instruct PowerShell not to
       interpret any characters as escape sequences.

   -Path String[]
       The path to the archive file.

       Force the extraction of files from an archive file.

       Prompt for confirmation before executing the command.

       Describe what would happen if you executed the command without actually executing the command.


Extract the contents of an archive:

C:\PS> Expand-Archive -LiteralPath C:\output\new.Zip -DestinationPath C:\Restored

Extract the contents of an archive in the current folder:

C:\PS> Expand-Archive -Path new.Zip -DestinationPath C:\Restored

“You go away for a long time and return a different person - you never come all the way back” ~ Paul Theroux

Related PowerShell Cmdlets:

Compress-Archive - Create a new archive/zipped file.

Copyright © 1999-2021 SS64.com
Some rights reserved