-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathpurge.ps1
58 lines (49 loc) · 1.47 KB
/
purge.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Write-Host 'Always wise to purge the rabble'
$folderNames = 'obj', 'bin', 'CoverageResults', 'TestResult', 'TestResult*'
foreach ($folderName in $folderNames) {
$folders = Get-ChildItem -Path $foldername -recurse
foreach ($folder in $folders) {
if (Test-Path $folder.FullName)
{
Write-Host 'Deleting ' $folder.FullName;
Remove-Item -Path $folder.FullName -recurse -Force
}
}
}
$fileNames = 'coverage*.json', 'coverage*.xml', 'coverage*.info', '*.nupkg', '*.snupkg'
foreach ($fileName in $fileNames) {
$files = Get-ChildItem $fileName -recurse
foreach ($file in $files)
{
if (Test-Path file.FullName)
{
Write-Host 'Deleting ' file.FullName;
Remove-Item -Path $file.FullName -recurse -Force
}
}
}
if (Test-Path nupkgs) {
Write-Host "Deleting nupkgs"
Remove-Item -Path nupkgs -recurse -Force
}
if (Test-Path sign) {
Write-Host "Deleting sign"
Remove-Item -Path sign -recurse -Force
}
if (Test-Path *.binlog) {
Write-Host "Deleting binlogs"
Remove-Item -Path *.binlog -recurse -Force
}
if (Test-Path TestResults) {
Write-Host "Deleting TestResults"
Remove-Item -Path TestResults -recurse -Force
}
if (Test-Path docs\api) {
Write-Host "Deleting docfx extracted api documentation"
Remove-Item -Path docs\api -recurse -Force
}
if (Test-Path docs\_site) {
Write-Host "Deleting docfx generated site"
Remove-Item -Path docs\_site -recurse -Force
}
Write-Host 'Done'