Skip to content

Instantly share code, notes, and snippets.

@stefanteixeira
Last active January 20, 2021 04:23
Show Gist options
  • Save stefanteixeira/0428e8ade6be09d94b90 to your computer and use it in GitHub Desktop.
Save stefanteixeira/0428e8ade6be09d94b90 to your computer and use it in GitHub Desktop.

Revisions

  1. stefanteixeira revised this gist Sep 1, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions ZipFolder.ps1
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    $source = "C:\bla"
    $destination = "C:\bla.zip"
    $source = "C:\Path\To\Directory"
    $destination = "C:\Path\To\Zip\file.zip"

    If(Test-path $destination) {Remove-item $destination}
    Add-Type -assembly "system.io.compression.filesystem"
  2. stefanteixeira created this gist Aug 26, 2015.
    6 changes: 6 additions & 0 deletions ZipFolder.ps1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    $source = "C:\bla"
    $destination = "C:\bla.zip"

    If(Test-path $destination) {Remove-item $destination}
    Add-Type -assembly "system.io.compression.filesystem"
    [io.compression.zipfile]::CreateFromDirectory($Source, $destination)