title: How to zip files created on a specific date using powershell?
body: <p>I have a script in place to zip all the files which were created on a specific date.</p>
  
  <pre><code>Add-Type -AssemblyName System.IO.Compression.FileSystem 
  
  $logfolder = "c:\users\riteshthakur\desktop\abc"
  $startdate = "20161205"
  $enddate = "20161205"
  
  [System.IO.Compression.ZipArchive] $arch = [System.IO.Compression.ZipFile]::Open('c:\users\riteshthakur\desktop\arch.zip', [System.IO.Compression.ZipArchiveMode]::Update)
  
  Get-ChildItem - path $logFolder | 
  Where-Object {$_.CreationDate -gt $startDate -and $_.CreationDate -lt $endDate} | 
  foreach{[System.IO.Compression.ZipFileExtensions]::CreateEntryFromFile($arch,$_.FullName,$_.Name)}
  # archive will be updated with files after you close it. normally, in C#, you would use "using ZipArchvie arch = new ZipFile" and object would be disposed upon exiting "using" block. here you have to dispose manually:
  $arch.Dispose()
  </code></pre>
  
  <p>I am running this script but this is throwing : "Cannot add type. The assembly 'System.IO.Compression.FileSystem' could not be found."</p>
  
  <p>Please help. </p>