301_zip.ps1 1.3 KB

12345678910111213141516171819202122232425
  1. #**************************************************************************#
  2. #** QUADARAX DEPLOYMENT SCRIPTS **#
  3. #** File: 301_zip.ps1 **#
  4. #** Description: PowerShell script library to zip minimal version **#
  5. #** Version: 1.0. **#
  6. #** Updated: 29.7.2019 **#
  7. #**************************************************************************#
  8. param(
  9. # Defines alternative zip file. If not defined uses automatic name
  10. [string] $alternativeZipFileName
  11. )
  12. . ./000_bootstrap.ps1
  13. # Validate inputs
  14. if (!$alternativeZipFileName) { $alternativeZipFileName = "$zipNamePrefix$(get-date -f yyyy-MM-dd).7z"}
  15. Write-Host ("Zipping directory {0}" -f $projectDir) -ForegroundColor Yellow
  16. Write-Host ("Zipping to archive {0}" -f $alternativeZipFileName) -ForegroundColor Yellow
  17. Remove-Item $alternativeZipFileName -Force
  18. Write-Host "*** ZIPPING - START ***" -ForegroundColor Green
  19. # -xr!.vs -xr!*.user -xr!packages -xr!TestResults -xr!resharper*
  20. 7zip a -tzip $alternativeZipFileName $projectDir\ -mx0 -xr!bin -xr!obj -xr!packages -xr!TestResults -xr!resharper*
  21. Write-Host "*** ZIPPING - END ***" -ForegroundColor Green