mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-29 05:09:05 +02:00
Updated remove-old-dirs.ps1
This commit is contained in:
parent
1409e438c6
commit
3186552960
@ -18,8 +18,8 @@
|
|||||||
param([string]$path = "", [int]$numDays = 1000)
|
param([string]$path = "", [int]$numDays = 1000)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$stopWatch = [system.diagnostics.stopwatch]::startNew()
|
|
||||||
if ("$path" -eq "") { $path = Read-Host "Enter the file path to the parent folder" }
|
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" }
|
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..."
|
Write-Host "⏳ Searching for subfolders at '$path' older than $numDays days..."
|
||||||
|
Loading…
Reference in New Issue
Block a user