ComponentPro UltimateZip

      Using UltimateZip in PowerShell

      Language Filter: AllSend comments on this topic to ComponentPro

      With only few steps, you can easily and quickly use UltimateZip component in PowerShell as described below:

      Loading assembly

      To load UltimateZip component for using in PowerShell, simply use the [Reflection.Assembly]::LoadFrom command as demonstrated below:

      PowerShell - Loading Assembly
      PS C:\> [Reflection.Assembly]::LoadFrom("C:\Program Files (x86)\ComponentPro\UltimateZip vX.X.X.X\Bin\Net\ComponentPro.Zip.dll")

      Loading the assembly from GAC

      PowerShell - Loading Assembly from GAC
      PS C:\> [Reflection.Assembly]::LoadFrom("ComponentPro.Zip, Version=X.X.X.X, Culture=neutral, PublicKeyToken=57834bcd05a91756")

      Using Zip class

      Now you are ready to use all classes inside the UltimateZip component. For example, to create a new archive and add files to the archive, you can use the following script:

      PowerShell - Using UltimateZip
      PS C:\> $zip = New-Object ComponentPro.Compression.Zip
      
      PS C:\> $zip.Create("test.zip")
      
      PS C:\> $zip.AddFile("test.dat")
      
      PS C:\> $zip.Close()
      
      PS C:\> $zip.Dispose()