Expand-Archive (PowerShell 5+)

Extract files from an archive (zipped) file.

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

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

key
   -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
       Force the extraction of files from an archive file.

   -Confirm
       Prompt for confirmation before executing the command.

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

   CommonParameters:
       -Verbose, -Debug, -ErrorAction, -ErrorVariable, -WarningAction, -WarningVariable,
       -OutBuffer -OutVariable.

Examples

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:

Compress-Archive - Create a new archive/zipped file


© Copyright SS64.com 1999-2017
Some rights reserved