Zip missing in toolkit

//Zip missing in toolkit
Zip missing in toolkit 2017-04-11T17:15:43+00:00

The Toolkit Forums Toolkit Extensions Zip missing in toolkit

  • Author
  • Francois
    Post count: 101
    #2082 |


    I had to package some ziped Java file. So to deploy them, I was believing using the toolkit to unzip those files. I was surprise to see PSADTK containing a way to create a zip but not to unzip a file.

    So I wrote a way to unzip de file.

    <code>Function Expand-ZIP {
    		Permet de decompresser des fichiers ZIP
    		Permet de decompresser des fichiers ZIP
            - Emplacement complet du fichier zippé source a déterminer et aussi le repertoire de destination
            - Le repertoire clible sera creer automatiquement si il est absent.
            $zipfile pour le chemin complet et le fichier zip
            $outpath pour le repertoire de destination
           Expand-ZIP &quot;$Var_SourceFiles\; &quot;$env:systemdrive\PATCH_JDEV12&quot;
    	Param (
    		## Specify process names separated by commas. Optionally specify a process description with an equals symbol, e.g. &quot;winword=Microsoft Office Word&quot;
    	Begin {
    		## Get the name of this function and write header
    		[string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name
    		Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header
    	Process {
            Try {
                Add-Type -AssemblyName System.IO.Compression.FileSystem
                [System.IO.Compression.ZipFile]::ExtractToDirectory($Str_zipfile, $Str_outpath)
            Catch {
                Set-StrictMode -off
    				[int32]$mainExitCode = 1
    				[string]$mainErrorMessage = &quot;$(Resolve-Error)&quot;
    				Write-Log -Message $mainErrorMessage -Severity 3 -Source $deployAppScriptFriendlyName
    				Show-DialogBox -Text $mainErrorMessage -Icon &#039;Stop&#039;
    				Exit-Script -ExitCode $mainExitCode
    			Set-StrictMode -Version Latest
        End {Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer}

You must be logged in to reply to this topic.