-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClean-TemporaryFiles.ps1
More file actions
27 lines (24 loc) · 815 Bytes
/
Clean-TemporaryFiles.ps1
File metadata and controls
27 lines (24 loc) · 815 Bytes
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
param(
[switch]$WhatIf = $false
)
$FileTypes = @(
".intunewin"
".exe"
".msi"
".log"
)
$RepoRoot = Join-Path $PSScriptRoot '../'
$x = Get-ChildItem $RepoRoot -Recurse -File | Where-Object { $FileTypes -contains $_.Extension }
$amount = $x.Length
$x | Remove-Item -Force -WhatIf:$WhatIf
if(-not $WhatIf){ Write-Output "Removed $amount item(s)" }
$MkDocsOutput = Join-Path $PSScriptRoot '../Wiki/site'
$MkDocsAssetCache = Join-Path $PSScriptRoot '../.cache'
if(Test-Path $MkDocsOutput){
Remove-Item $MkDocsOutput -Recurse -Force -WhatIf:$WhatIf
if(-not $WhatIf){ Write-Output "Cleared built MkDocs site 'Wiki/site'" }
}
if(Test-Path $MkDocsAssetCache){
Remove-Item $MkDocsAssetCache -Recurse -Force -WhatIf:$WhatIf
if(-not $WhatIf){ Write-Output "Cleared MkDocs Asset Cache" }
}