-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcleaner.ps1
More file actions
20 lines (17 loc) · 764 Bytes
/
cleaner.ps1
File metadata and controls
20 lines (17 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Copyright (c) Matthias Wolf, Mawosoft.
<#
.SYNOPSIS
Delete bin/obj subfolders, optionally delete *.binlog files/subfolders, call all cleaner.ps1 in subfolders.
#>
[CmdletBinding(SupportsShouldProcess)]
Param (
[Alias("bl")]
# Also delete *.binlog files/subfolders
[switch]$BinLog
)
Get-ChildItem -Path $PSScriptRoot -Directory -Recurse -Include bin, obj | Remove-Item -Recurse
Get-ChildItem -Path $PSScriptRoot -Filter cleaner.ps1 -Recurse -File | Where-Object DirectoryName -ne $PSScriptRoot | ForEach-Object { & $_.FullName }
if ($BinLog.IsPresent) {
Get-ChildItem -Path $PSScriptRoot -Directory -Recurse -Include MSBuild_Logs | Remove-Item -Recurse
Get-ChildItem -Path $PSScriptRoot -File -Recurse -Include *.binlog | Remove-Item
}