#**************************************************************************#
#**  QUADARAX DEPLOYMENT SCRIPTS                                         **#
#**  File: 300_cleanup.ps1                                               **#
#**  Description: PowerShell script library to cleanup all projects      **#
#**               folder to minimal size                                 **#
#**  Version: 1.0.                                                       **#
#**  Updated: 29.7.2019                                                  **# 
#**************************************************************************#
. ./000_bootstrap.ps1

Write-Host "*** CLEANINGUP - START ***" -ForegroundColor Green
$removeRoot = "$projectDir\"
$i = 0
Get-ChildItem $removeRoot -include bin,obj,*.user,packages,TestResults,resharper*  -Recurse | foreach ($_) { 
    Remove-Item $_.fullname -Force -Recurse 
    Write-Host ("Deleted file {0}" -f $_.fullname) -ForegroundColor White
    $i = $i + 1
}
Get-ChildItem $removeRoot -include .vs -Recurse -Hidden | foreach ($_) { 
    Remove-Item $_.fullname -Force -Recurse 
    Write-Host ("Deleted file {0}" -f $_.fullname) -ForegroundColor White
    $i = $i + 1
}
Write-Host ("Deleted {0} files" -f $i) -ForegroundColor Yellow
Write-Host "*** CLEANINGUP - END ***" -ForegroundColor Green
