Updated remove-old-dirs.ps1

This commit is contained in:
Markus Fleschutz 2025-01-14 16:35:32 +01:00
parent 1409e438c6
commit 3186552960

View File

@ -18,8 +18,8 @@
param([string]$path = "", [int]$numDays = 1000)
try {
$stopWatch = [system.diagnostics.stopwatch]::startNew()
if ("$path" -eq "") { $path = Read-Host "Enter the file path to the parent folder" }
$stopWatch = [system.diagnostics.stopwatch]::startNew()
if (!(Test-Path -Path "$path" -PathType container)) { throw "Given path doesn't exist - enter a valid path, please" }
Write-Host "⏳ Searching for subfolders at '$path' older than $numDays days..."