-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReset-Umbraco-Local.ps1
More file actions
24 lines (20 loc) · 979 Bytes
/
Reset-Umbraco-Local.ps1
File metadata and controls
24 lines (20 loc) · 979 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
# This script deletes the 'Data' and 'Logs' folders inside any '*.Web\umbraco' directory from the script's location.
# Find all *.TestSite\umbraco folders under the script's directory
$umbracoFolders = Get-ChildItem -Path $PSScriptRoot -Recurse -Directory |
Where-Object { $_.FullName -match '\\src\\[^\\]+\.TestSite\\umbraco$' }
foreach ($umbracoPath in $umbracoFolders) {
$dataPath = Join-Path -Path $umbracoPath.FullName -ChildPath "Data"
$logsPath = Join-Path -Path $umbracoPath.FullName -ChildPath "Logs"
if (Test-Path $dataPath) {
Remove-Item $dataPath -Recurse -Force -ErrorAction SilentlyContinue
Write-Output "Removed folder: $dataPath"
} else {
Write-Output "Folder not found: $dataPath"
}
if (Test-Path $logsPath) {
Remove-Item $logsPath -Recurse -Force -ErrorAction SilentlyContinue
Write-Output "Removed folder: $logsPath"
} else {
Write-Output "Folder not found: $logsPath"
}
}