-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcleanup.ps1
More file actions
23 lines (18 loc) · 811 Bytes
/
cleanup.ps1
File metadata and controls
23 lines (18 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#Set-ExecutionPolicy -ExecutionPolicy unrestricted -scope process
if (!(Get-Command "Get-ScriptDirectory" -errorAction SilentlyContinue))
{
function Get-ScriptDirectory
{
$Invocation = (Get-Variable MyInvocation -Scope 1).Value
Split-Path $Invocation.MyCommand.Path
}
}
$root = Get-ScriptDirectory
$dirToClean = $root + "\CSharp"
Write-Host "Cleaning", $dirToClean
# Delete bin and obj folders
dir $dirToClean -r | where { $_ -is [System.IO.DirectoryInfo] } | where { $_.Name -eq "bin" -or $_.Name -eq "obj"} | % { $_.Delete($true) }
$dirToClean = $root + "\Homework-Tests"
Write-Host "Cleaning", $dirToClean
# Delete bin and obj folders
dir $dirToClean -r | where { $_ -is [System.IO.DirectoryInfo] } | where { $_.Name -eq "bin" -or $_.Name -eq "obj"} | % { $_.Delete($true) }