300_cleanup.ps1 1.3 KB

12345678910111213141516171819202122232425
  1. #**************************************************************************#
  2. #** QUADARAX DEPLOYMENT SCRIPTS **#
  3. #** File: 300_cleanup.ps1 **#
  4. #** Description: PowerShell script library to cleanup all projects **#
  5. #** folder to minimal size **#
  6. #** Version: 1.0. **#
  7. #** Updated: 29.7.2019 **#
  8. #**************************************************************************#
  9. . ./000_bootstrap.ps1
  10. Write-Host "*** CLEANINGUP - START ***" -ForegroundColor Green
  11. $removeRoot = "$projectDir\"
  12. $i = 0
  13. Get-ChildItem $removeRoot -include bin,obj,*.user,packages,TestResults,resharper* -Recurse | foreach ($_) {
  14. Remove-Item $_.fullname -Force -Recurse
  15. Write-Host ("Deleted file {0}" -f $_.fullname) -ForegroundColor White
  16. $i = $i + 1
  17. }
  18. Get-ChildItem $removeRoot -include .vs -Recurse -Hidden | foreach ($_) {
  19. Remove-Item $_.fullname -Force -Recurse
  20. Write-Host ("Deleted file {0}" -f $_.fullname) -ForegroundColor White
  21. $i = $i + 1
  22. }
  23. Write-Host ("Deleted {0} files" -f $i) -ForegroundColor Yellow
  24. Write-Host "*** CLEANINGUP - END ***" -ForegroundColor Green