Extract contents of a compressed archive file
Use Expand-7Zip to extract the contents of an archive.

Extract contents of in the current working folder

Expand-7Zip -DestinationPath c:\archive

Extract contents of in the c:\archive folder

Expand-7Zip "c:\folder\files.gz"

Extract contents of c:\folder\files.gz into current working folder

The full path of the compressed archive file.
.PARAMETER DestinationPath
The output directory.
If $True this will remove the compressed version of the file only leaving the uncompressed contents.

Function Expand-7Zip {
        [ValidateScript({$_ | Test-Path -PathType Leaf})]


    Begin {}
    Process {
        Write-Verbose -Message 'Extracting contents of compressed archive file'
        If ($DestinationPath) {
            & "$7zaBinary" x -o"$DestinationPath" "$FullName"
        } Else {
            & "$7zaBinary" x "$FullName"

        If ($Remove) {
            Write-Verbose -Message 'Removing compressed archive file'
            Remove-Item -Path "$FullName" -Force
    End {}