-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclean.ps1
38 lines (30 loc) · 1.05 KB
/
clean.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Function remove {
param([string]$item)
If (Test-Path $item){
Write-Host "Removing $item"
Remove-Item $item -Force -Recurse
}
}
Function Invoke-Cleanup {
Write-Host "---------------------"
Write-Host "Invoke-Cleanup"
Write-Host "---------------------"
# clean package, bin and obj folders
Get-ChildItem .\ -include packages,bin,obj,node_modules -Recurse | Where-Object {$_.FullName -NotMatch "BuildScripts"} | foreach ($_) { Write-Host "Removing " + $_.fullname; remove-item $_.fullname -Force -Recurse }
#Find nunit files
Get-ChildItem -include *.nunit -Recurse |
ForEach-Object{
Write-Host $_
$results = $_.BaseName + ".xml"
If (Test-Path $results){
Write-Host "Removing $results"
Remove-Item $results
}
}
remove "TestResults"
remove "OpenCover"
remove "Publish"
remove "TestBin"
#return $true
}
Invoke-Cleanup