{"id":13599443,"url":"https://github.com/EliteLoser/RemoveOldFiles","last_synced_at":"2025-04-10T12:32:47.370Z","repository":{"id":55006456,"uuid":"162036217","full_name":"EliteLoser/RemoveOldFiles","owner":"EliteLoser","description":"Use Svendsen Tech's Remove-OldFiles function to delete files based on date logic with time granularity ranging from milliseconds to months, and an optional file name regex filter.","archived":false,"fork":false,"pushed_at":"2021-01-15T22:07:09.000Z","size":50,"stargazers_count":6,"open_issues_count":5,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-07T00:42:54.077Z","etag":null,"topics":["date","files","old","powershell","remove","svendsentech"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EliteLoser.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-16T20:01:18.000Z","updated_at":"2022-12-05T00:30:46.000Z","dependencies_parsed_at":"2022-08-14T08:50:44.925Z","dependency_job_id":null,"html_url":"https://github.com/EliteLoser/RemoveOldFiles","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EliteLoser%2FRemoveOldFiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EliteLoser%2FRemoveOldFiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EliteLoser%2FRemoveOldFiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EliteLoser%2FRemoveOldFiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EliteLoser","download_url":"https://codeload.github.com/EliteLoser/RemoveOldFiles/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248217145,"owners_count":21066633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["date","files","old","powershell","remove","svendsentech"],"created_at":"2024-08-01T17:01:04.262Z","updated_at":"2025-04-10T12:32:46.834Z","avatar_url":"https://github.com/EliteLoser.png","language":"PowerShell","readme":"# RemoveOldFiles\n\nUse Svendsen Tech's `Remove-OldFiles` function to delete files based on date logic with time granularity ranging from milliseconds to months, and an optional file name regex filter.\n\nRemoves files that are \"older\" than the specified number of milliseconds,\nseconds, minutes, hours, days, weeks or months - or a combination of any\nof these, as calculated based on the \"LastWriteTime\" property returned from Get-Item, for determining \"age\". All the specified time units are added together.\n\nOptional file name filtering with a regular expression, otherwise all files are targeted.\n\nOptional recursion. Resolve-Path support that allows for directories for instance two levels deep with something like `-Path C:\\foo\\*\\*`.\n\nThe times specified from ms to months are all cumulated and added together to\nform a large decimal-typed millisecond number. Time units are converted to milliseconds and handled with .NET date\nmath. This should also account for the corner cases of leap seconds as of v1.1.0 of the module. In v1.0 (as currently in the \nPSGallery; working on publishing the updated one), only months are handled with .NET date math.\n\nYou can specify a `-NameRegexMatch` parameter to only target only file names\nthat match this regular expression. The default is simply `.*`.\n\nThis regex always matches, so name filtering is in effect not enabled by default unless you override with this\nparameter. NB! It is not wildcards such as for the `-like` operator, but regular\nexpressions, such as for the `-match` operator, so make sure you test and know that the results are as expected. I plan to implement a \n`-NameWildcardMatch` parameter, but might put it off for years, knowing myself. Demand helps...\n\nIt supports -WhatIf in a non-proper implementation currently (but functionally not\ntoo different, it was just a bit easier and also caused by a now gone, dead end in code).\nI'm in two minds about changing it to the proper implementation, but will likely do it soon for\nassumed broader acceptance of the code.\n\n# Installation from the PowerShell Gallery\n\nThe module is published to the PowerShell Gallery, so you can install it with for instance this command for your user only:\n\n`Install-Module -Name RemoveOldFiles -Scope CurrentUser #-Force`\n\nOr you can download it with:\n\n`Save-Module -Name RemoveOldFiles -Path C:\\Scripts`\n\nAnd inspect it first with:\n\n`Find-Module -Name RemoveOldFiles | Format-List *`\n\n# Examples\n\n```\n\nPS C:\\temp\\testdir\u003e $mydir, \"$mydir/1\", \"$mydir/1/2\", \"$mydir/1/2/3\" | %{\n    New-RandomData -Path $_ -BaseName keepThese -Extension .log -Count 3 `\n    -Size 1024 -LineLength 128 }\n\nPS C:\\temp\\testdir\u003e $mydir, \"$mydir/1\", \"$mydir/1/2\", \"$mydir/1/2/3\" | %{\n    New-RandomData -Path $_ -BaseName deletethese -Extension .tmp -Count 3 `\n    -Size 1024 -LineLength 128 }\n\nPS C:\\temp\\testdir\u003e ipmo ..\\RemoveOldFiles -Force\n\nPS C:\\temp\\testdir\u003e Remove-OldFiles -Path ., ./1/2 -WhatIf -Second 1\nVERBOSE: Recorded 'now' time as: 2018-12-17 21:09:16\nVERBOSE: Total milliseconds: 1000.\n0 months.\n0 weeks.\n0 days.\n0 hours.\n0 minutes.\n1 seconds.\n0 milliseconds.\nVERBOSE: Processing path '.'.\nVERBOSE: In foreach $TempTempPath processing path 'C:\\temp\\testdir'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir'.\nVERBOSE: Processing first level directory with path: 'C:\\temp\\testdir'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1'.\nVERBOSE: -Recurse parameter not specified, so directory 'C:\\temp\\testdir\\1' is skipped.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\RandomData'.\nVERBOSE: -Recurse parameter not specified, so directory 'C:\\temp\\testdir\\RandomData' is skipped.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\deletethese1.tmp'.\nVERBOSE: Would have removed 'C:\\temp\\testdir\\deletethese1.tmp because it was modified more than 1000 ms ago and matches the specified name regex: '.*' (default '.*\n'), without -WhatIf in use.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\deletethese2.tmp'.\nVERBOSE: Would have removed 'C:\\temp\\testdir\\deletethese2.tmp because it was modified more than 1000 ms ago and matches the specified name regex: '.*' (default '.*\n'), without -WhatIf in use.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\deletethese3.tmp'.\nVERBOSE: Would have removed 'C:\\temp\\testdir\\deletethese3.tmp because it was modified more than 1000 ms ago and matches the specified name regex: '.*' (default '.*\n'), without -WhatIf in use.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\keepThese1.log'.\nVERBOSE: Would have removed 'C:\\temp\\testdir\\keepThese1.log because it was modified more than 1000 ms ago and matches the specified name regex: '.*' (default '.*')\n, without -WhatIf in use.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\keepThese2.log'.\nVERBOSE: Would have removed 'C:\\temp\\testdir\\keepThese2.log because it was modified more than 1000 ms ago and matches the specified name regex: '.*' (default '.*')\n, without -WhatIf in use.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\keepThese3.log'.\nVERBOSE: Would have removed 'C:\\temp\\testdir\\keepThese3.log because it was modified more than 1000 ms ago and matches the specified name regex: '.*' (default '.*')\n, without -WhatIf in use.\nVERBOSE: Processing path './1/2'.\nVERBOSE: In foreach $TempTempPath processing path 'C:\\temp\\testdir\\1\\2'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2'.\nVERBOSE: Processing first level directory with path: 'C:\\temp\\testdir\\1\\2'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\3'.\nVERBOSE: -Recurse parameter not specified, so directory 'C:\\temp\\testdir\\1\\2\\3' is skipped.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\deletethese1.tmp'.\nVERBOSE: Would have removed 'C:\\temp\\testdir\\1\\2\\deletethese1.tmp because it was modified more than 1000 ms ago and matches the specified name regex: '.*' (default\n '.*'), without -WhatIf in use.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\deletethese2.tmp'.\nVERBOSE: Would have removed 'C:\\temp\\testdir\\1\\2\\deletethese2.tmp because it was modified more than 1000 ms ago and matches the specified name regex: '.*' (default\n '.*'), without -WhatIf in use.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\deletethese3.tmp'.\nVERBOSE: Would have removed 'C:\\temp\\testdir\\1\\2\\deletethese3.tmp because it was modified more than 1000 ms ago and matches the specified name regex: '.*' (default\n '.*'), without -WhatIf in use.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\keepThese1.log'.\nVERBOSE: Would have removed 'C:\\temp\\testdir\\1\\2\\keepThese1.log because it was modified more than 1000 ms ago and matches the specified name regex: '.*' (default '\n.*'), without -WhatIf in use.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\keepThese2.log'.\nVERBOSE: Would have removed 'C:\\temp\\testdir\\1\\2\\keepThese2.log because it was modified more than 1000 ms ago and matches the specified name regex: '.*' (default '\n.*'), without -WhatIf in use.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\keepThese3.log'.\nVERBOSE: Would have removed 'C:\\temp\\testdir\\1\\2\\keepThese3.log because it was modified more than 1000 ms ago and matches the specified name regex: '.*' (default '\n.*'), without -WhatIf in use.\nVERBOSE: Total processed path count was: 17\nVERBOSE: Would have attempted to delete 12 files without -WhatIf in use.\n\nPS C:\\temp\\testdir\u003e Remove-OldFiles -Path ., ./1/2 -WhatIf -Second 1 -NameRegex '\\.tmp$'\nVERBOSE: Recorded 'now' time as: 2018-12-17 21:09:44\nVERBOSE: Total milliseconds: 1000.\n0 months.\n0 weeks.\n0 days.\n0 hours.\n0 minutes.\n1 seconds.\n0 milliseconds.\nVERBOSE: Processing path '.'.\nVERBOSE: In foreach $TempTempPath processing path 'C:\\temp\\testdir'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir'.\nVERBOSE: Processing first level directory with path: 'C:\\temp\\testdir'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1'.\nVERBOSE: -Recurse parameter not specified, so directory 'C:\\temp\\testdir\\1' is skipped.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\RandomData'.\nVERBOSE: -Recurse parameter not specified, so directory 'C:\\temp\\testdir\\RandomData' is skipped.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\deletethese1.tmp'.\nVERBOSE: Would have removed 'C:\\temp\\testdir\\deletethese1.tmp because it was modified more than 1000 ms ago and matches the specified name regex: '\\.tmp$' (default\n '.*'), without -WhatIf in use.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\deletethese2.tmp'.\nVERBOSE: Would have removed 'C:\\temp\\testdir\\deletethese2.tmp because it was modified more than 1000 ms ago and matches the specified name regex: '\\.tmp$' (default\n '.*'), without -WhatIf in use.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\deletethese3.tmp'.\nVERBOSE: Would have removed 'C:\\temp\\testdir\\deletethese3.tmp because it was modified more than 1000 ms ago and matches the specified name regex: '\\.tmp$' (default\n '.*'), without -WhatIf in use.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\keepThese1.log'.\nVERBOSE: Ignoring. -WhatIf in use and file 'C:\\temp\\testdir\\keepThese1.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\keepThese2.log'.\nVERBOSE: Ignoring. -WhatIf in use and file 'C:\\temp\\testdir\\keepThese2.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\keepThese3.log'.\nVERBOSE: Ignoring. -WhatIf in use and file 'C:\\temp\\testdir\\keepThese3.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: Processing path './1/2'.\nVERBOSE: In foreach $TempTempPath processing path 'C:\\temp\\testdir\\1\\2'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2'.\nVERBOSE: Processing first level directory with path: 'C:\\temp\\testdir\\1\\2'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\3'.\nVERBOSE: -Recurse parameter not specified, so directory 'C:\\temp\\testdir\\1\\2\\3' is skipped.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\deletethese1.tmp'.\nVERBOSE: Would have removed 'C:\\temp\\testdir\\1\\2\\deletethese1.tmp because it was modified more than 1000 ms ago and matches the specified name regex: '\\.tmp$' (def\nault '.*'), without -WhatIf in use.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\deletethese2.tmp'.\nVERBOSE: Would have removed 'C:\\temp\\testdir\\1\\2\\deletethese2.tmp because it was modified more than 1000 ms ago and matches the specified name regex: '\\.tmp$' (def\nault '.*'), without -WhatIf in use.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\deletethese3.tmp'.\nVERBOSE: Would have removed 'C:\\temp\\testdir\\1\\2\\deletethese3.tmp because it was modified more than 1000 ms ago and matches the specified name regex: '\\.tmp$' (def\nault '.*'), without -WhatIf in use.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\keepThese1.log'.\nVERBOSE: Ignoring. -WhatIf in use and file 'C:\\temp\\testdir\\1\\2\\keepThese1.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\keepThese2.log'.\nVERBOSE: Ignoring. -WhatIf in use and file 'C:\\temp\\testdir\\1\\2\\keepThese2.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\keepThese3.log'.\nVERBOSE: Ignoring. -WhatIf in use and file 'C:\\temp\\testdir\\1\\2\\keepThese3.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: Total processed path count was: 17\nVERBOSE: Would have attempted to delete 6 files without -WhatIf in use.\n\nPS C:\\temp\\testdir\u003e Remove-OldFiles -Path . -WhatIf -Second 1 -NameRegex '\\.tmp$' -Recurse\nVERBOSE: Recorded 'now' time as: 2018-12-17 21:10:02\nVERBOSE: Total milliseconds: 1000.\n0 months.\n0 weeks.\n0 days.\n0 hours.\n0 minutes.\n1 seconds.\n0 milliseconds.\nVERBOSE: Processing path '.'.\nVERBOSE: In foreach $TempTempPath processing path 'C:\\temp\\testdir'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir'.\nVERBOSE: Processing first level directory with path: 'C:\\temp\\testdir'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1'.\nVERBOSE: Processing first level directory with path: 'C:\\temp\\testdir\\1'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2'.\nVERBOSE: Processing first level directory with path: 'C:\\temp\\testdir\\1\\2'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\3'.\nVERBOSE: Processing first level directory with path: 'C:\\temp\\testdir\\1\\2\\3'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\3\\deletethese1.tmp'.\nVERBOSE: Would have removed 'C:\\temp\\testdir\\1\\2\\3\\deletethese1.tmp because it was modified more than 1000 ms ago and matches the specified name regex: '\\.tmp$' (d\nefault '.*'), without -WhatIf in use.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\3\\deletethese2.tmp'.\nVERBOSE: Would have removed 'C:\\temp\\testdir\\1\\2\\3\\deletethese2.tmp because it was modified more than 1000 ms ago and matches the specified name regex: '\\.tmp$' (d\nefault '.*'), without -WhatIf in use.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\3\\deletethese3.tmp'.\nVERBOSE: Would have removed 'C:\\temp\\testdir\\1\\2\\3\\deletethese3.tmp because it was modified more than 1000 ms ago and matches the specified name regex: '\\.tmp$' (d\nefault '.*'), without -WhatIf in use.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\3\\keepThese1.log'.\nVERBOSE: Ignoring. -WhatIf in use and file 'C:\\temp\\testdir\\1\\2\\3\\keepThese1.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\3\\keepThese2.log'.\nVERBOSE: Ignoring. -WhatIf in use and file 'C:\\temp\\testdir\\1\\2\\3\\keepThese2.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\3\\keepThese3.log'.\nVERBOSE: Ignoring. -WhatIf in use and file 'C:\\temp\\testdir\\1\\2\\3\\keepThese3.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\deletethese1.tmp'.\nVERBOSE: Would have removed 'C:\\temp\\testdir\\1\\2\\deletethese1.tmp because it was modified more than 1000 ms ago and matches the specified name regex: '\\.tmp$' (def\nault '.*'), without -WhatIf in use.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\deletethese2.tmp'.\nVERBOSE: Would have removed 'C:\\temp\\testdir\\1\\2\\deletethese2.tmp because it was modified more than 1000 ms ago and matches the specified name regex: '\\.tmp$' (def\nault '.*'), without -WhatIf in use.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\deletethese3.tmp'.\nVERBOSE: Would have removed 'C:\\temp\\testdir\\1\\2\\deletethese3.tmp because it was modified more than 1000 ms ago and matches the specified name regex: '\\.tmp$' (def\nault '.*'), without -WhatIf in use.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\keepThese1.log'.\nVERBOSE: Ignoring. -WhatIf in use and file 'C:\\temp\\testdir\\1\\2\\keepThese1.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\keepThese2.log'.\nVERBOSE: Ignoring. -WhatIf in use and file 'C:\\temp\\testdir\\1\\2\\keepThese2.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\keepThese3.log'.\nVERBOSE: Ignoring. -WhatIf in use and file 'C:\\temp\\testdir\\1\\2\\keepThese3.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\deletethese1.tmp'.\nVERBOSE: Would have removed 'C:\\temp\\testdir\\1\\deletethese1.tmp because it was modified more than 1000 ms ago and matches the specified name regex: '\\.tmp$' (defau\nlt '.*'), without -WhatIf in use.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\deletethese2.tmp'.\nVERBOSE: Would have removed 'C:\\temp\\testdir\\1\\deletethese2.tmp because it was modified more than 1000 ms ago and matches the specified name regex: '\\.tmp$' (defau\nlt '.*'), without -WhatIf in use.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\deletethese3.tmp'.\nVERBOSE: Would have removed 'C:\\temp\\testdir\\1\\deletethese3.tmp because it was modified more than 1000 ms ago and matches the specified name regex: '\\.tmp$' (defau\nlt '.*'), without -WhatIf in use.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\keepThese1.log'.\nVERBOSE: Ignoring. -WhatIf in use and file 'C:\\temp\\testdir\\1\\keepThese1.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\keepThese2.log'.\nVERBOSE: Ignoring. -WhatIf in use and file 'C:\\temp\\testdir\\1\\keepThese2.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\keepThese3.log'.\nVERBOSE: Ignoring. -WhatIf in use and file 'C:\\temp\\testdir\\1\\keepThese3.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\RandomData'.\nVERBOSE: Processing first level directory with path: 'C:\\temp\\testdir\\RandomData'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\RandomData\\1.2'.\nVERBOSE: Processing first level directory with path: 'C:\\temp\\testdir\\RandomData\\1.2'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\RandomData\\1.2\\RandomData.psd1'.\nVERBOSE: Ignoring. -WhatIf in use and file 'C:\\temp\\testdir\\RandomData\\1.2\\RandomData.psd1' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\RandomData\\1.2\\RandomData.psm1'.\nVERBOSE: Ignoring. -WhatIf in use and file 'C:\\temp\\testdir\\RandomData\\1.2\\RandomData.psm1' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\deletethese1.tmp'.\nVERBOSE: Would have removed 'C:\\temp\\testdir\\deletethese1.tmp because it was modified more than 1000 ms ago and matches the specified name regex: '\\.tmp$' (default\n '.*'), without -WhatIf in use.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\deletethese2.tmp'.\nVERBOSE: Would have removed 'C:\\temp\\testdir\\deletethese2.tmp because it was modified more than 1000 ms ago and matches the specified name regex: '\\.tmp$' (default\n '.*'), without -WhatIf in use.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\deletethese3.tmp'.\nVERBOSE: Would have removed 'C:\\temp\\testdir\\deletethese3.tmp because it was modified more than 1000 ms ago and matches the specified name regex: '\\.tmp$' (default\n '.*'), without -WhatIf in use.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\keepThese1.log'.\nVERBOSE: Ignoring. -WhatIf in use and file 'C:\\temp\\testdir\\keepThese1.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\keepThese2.log'.\nVERBOSE: Ignoring. -WhatIf in use and file 'C:\\temp\\testdir\\keepThese2.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\keepThese3.log'.\nVERBOSE: Ignoring. -WhatIf in use and file 'C:\\temp\\testdir\\keepThese3.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: Total processed path count was: 32\nVERBOSE: Would have attempted to delete 12 files without -WhatIf in use.\n\nPS C:\\temp\\testdir\u003e Remove-OldFiles -Path . -Second 1 -NameRegex '\\.tmp$' -Recurse # do it\nVERBOSE: Recorded 'now' time as: 2018-12-17 21:10:29\nVERBOSE: Total milliseconds: 1000.\n0 months.\n0 weeks.\n0 days.\n0 hours.\n0 minutes.\n1 seconds.\n0 milliseconds.\nVERBOSE: Processing path '.'.\nVERBOSE: In foreach $TempTempPath processing path 'C:\\temp\\testdir'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir'.\nVERBOSE: Processing first level directory with path: 'C:\\temp\\testdir'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1'.\nVERBOSE: Processing first level directory with path: 'C:\\temp\\testdir\\1'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2'.\nVERBOSE: Processing first level directory with path: 'C:\\temp\\testdir\\1\\2'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\3'.\nVERBOSE: Processing first level directory with path: 'C:\\temp\\testdir\\1\\2\\3'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\3\\deletethese1.tmp'.\nVERBOSE: Removing file 'C:\\temp\\testdir\\1\\2\\3\\deletethese1.tmp' because it was modified more than 1000 ms ago and matches the specified name regex: '\\.tmp$' (defau\nlt '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\3\\deletethese2.tmp'.\nVERBOSE: Removing file 'C:\\temp\\testdir\\1\\2\\3\\deletethese2.tmp' because it was modified more than 1000 ms ago and matches the specified name regex: '\\.tmp$' (defau\nlt '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\3\\deletethese3.tmp'.\nVERBOSE: Removing file 'C:\\temp\\testdir\\1\\2\\3\\deletethese3.tmp' because it was modified more than 1000 ms ago and matches the specified name regex: '\\.tmp$' (defau\nlt '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\3\\keepThese1.log'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\1\\2\\3\\keepThese1.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\3\\keepThese2.log'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\1\\2\\3\\keepThese2.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\3\\keepThese3.log'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\1\\2\\3\\keepThese3.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\deletethese1.tmp'.\nVERBOSE: Removing file 'C:\\temp\\testdir\\1\\2\\deletethese1.tmp' because it was modified more than 1000 ms ago and matches the specified name regex: '\\.tmp$' (default\n '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\deletethese2.tmp'.\nVERBOSE: Removing file 'C:\\temp\\testdir\\1\\2\\deletethese2.tmp' because it was modified more than 1000 ms ago and matches the specified name regex: '\\.tmp$' (default\n '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\deletethese3.tmp'.\nVERBOSE: Removing file 'C:\\temp\\testdir\\1\\2\\deletethese3.tmp' because it was modified more than 1000 ms ago and matches the specified name regex: '\\.tmp$' (default\n '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\keepThese1.log'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\1\\2\\keepThese1.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\keepThese2.log'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\1\\2\\keepThese2.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\keepThese3.log'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\1\\2\\keepThese3.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\deletethese1.tmp'.\nVERBOSE: Removing file 'C:\\temp\\testdir\\1\\deletethese1.tmp' because it was modified more than 1000 ms ago and matches the specified name regex: '\\.tmp$' (default '\n.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\deletethese2.tmp'.\nVERBOSE: Removing file 'C:\\temp\\testdir\\1\\deletethese2.tmp' because it was modified more than 1000 ms ago and matches the specified name regex: '\\.tmp$' (default '\n.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\deletethese3.tmp'.\nVERBOSE: Removing file 'C:\\temp\\testdir\\1\\deletethese3.tmp' because it was modified more than 1000 ms ago and matches the specified name regex: '\\.tmp$' (default '\n.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\keepThese1.log'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\1\\keepThese1.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\keepThese2.log'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\1\\keepThese2.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\keepThese3.log'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\1\\keepThese3.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\RandomData'.\nVERBOSE: Processing first level directory with path: 'C:\\temp\\testdir\\RandomData'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\RandomData\\1.2'.\nVERBOSE: Processing first level directory with path: 'C:\\temp\\testdir\\RandomData\\1.2'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\RandomData\\1.2\\RandomData.psd1'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\RandomData\\1.2\\RandomData.psd1' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\RandomData\\1.2\\RandomData.psm1'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\RandomData\\1.2\\RandomData.psm1' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\deletethese1.tmp'.\nVERBOSE: Removing file 'C:\\temp\\testdir\\deletethese1.tmp' because it was modified more than 1000 ms ago and matches the specified name regex: '\\.tmp$' (default '.*\n').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\deletethese2.tmp'.\nVERBOSE: Removing file 'C:\\temp\\testdir\\deletethese2.tmp' because it was modified more than 1000 ms ago and matches the specified name regex: '\\.tmp$' (default '.*\n').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\deletethese3.tmp'.\nVERBOSE: Removing file 'C:\\temp\\testdir\\deletethese3.tmp' because it was modified more than 1000 ms ago and matches the specified name regex: '\\.tmp$' (default '.*\n').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\keepThese1.log'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\keepThese1.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\keepThese2.log'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\keepThese2.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\keepThese3.log'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\keepThese3.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: Total processed path count was: 32\nVERBOSE: Attempted to delete 12 files.\n\nPS C:\\temp\\testdir\u003e # Attempted to delete 12 files\n\nPS C:\\temp\\testdir\u003e Remove-OldFiles -Path . -Second 1 -NameRegex '\\.tmp$' -Recurse # do it\nVERBOSE: Recorded 'now' time as: 2018-12-17 21:10:42\nVERBOSE: Total milliseconds: 1000.\n0 months.\n0 weeks.\n0 days.\n0 hours.\n0 minutes.\n1 seconds.\n0 milliseconds.\nVERBOSE: Processing path '.'.\nVERBOSE: In foreach $TempTempPath processing path 'C:\\temp\\testdir'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir'.\nVERBOSE: Processing first level directory with path: 'C:\\temp\\testdir'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1'.\nVERBOSE: Processing first level directory with path: 'C:\\temp\\testdir\\1'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2'.\nVERBOSE: Processing first level directory with path: 'C:\\temp\\testdir\\1\\2'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\3'.\nVERBOSE: Processing first level directory with path: 'C:\\temp\\testdir\\1\\2\\3'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\3\\keepThese1.log'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\1\\2\\3\\keepThese1.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\3\\keepThese2.log'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\1\\2\\3\\keepThese2.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\3\\keepThese3.log'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\1\\2\\3\\keepThese3.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\keepThese1.log'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\1\\2\\keepThese1.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\keepThese2.log'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\1\\2\\keepThese2.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\keepThese3.log'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\1\\2\\keepThese3.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\keepThese1.log'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\1\\keepThese1.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\keepThese2.log'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\1\\keepThese2.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\keepThese3.log'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\1\\keepThese3.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\RandomData'.\nVERBOSE: Processing first level directory with path: 'C:\\temp\\testdir\\RandomData'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\RandomData\\1.2'.\nVERBOSE: Processing first level directory with path: 'C:\\temp\\testdir\\RandomData\\1.2'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\RandomData\\1.2\\RandomData.psd1'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\RandomData\\1.2\\RandomData.psd1' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\RandomData\\1.2\\RandomData.psm1'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\RandomData\\1.2\\RandomData.psm1' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\keepThese1.log'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\keepThese1.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\keepThese2.log'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\keepThese2.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\keepThese3.log'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\keepThese3.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: Total processed path count was: 20\nVERBOSE: Attempted to delete 0 files.\n\nPS C:\\temp\\testdir\u003e # 0, so they were all successfully deleted\n\nPS C:\\temp\\testdir\u003e \n```\n\nExamples of Resolve-Path support baked in, without `-Recurse`, to do directories only one and two levels deep:\n\n```\nPS C:\\temp\\testdir\u003e Remove-OldFiles -Path ./*/* -Second 10 -NameRegexMatch '\\.tmp$'\nVERBOSE: Recorded 'now' time as: 2018-12-17 21:18:17\nVERBOSE: Total milliseconds: 10000.\n0 months.\n0 weeks.\n0 days.\n0 hours.\n0 minutes.\n10 seconds.\n0 milliseconds.\nVERBOSE: Processing path './*/*'.\nVERBOSE: In foreach $TempTempPath processing path 'C:\\temp\\testdir\\1\\2'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2'.\nVERBOSE: Processing first level directory with path: 'C:\\temp\\testdir\\1\\2'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\3'.\nVERBOSE: -Recurse parameter not specified, so directory 'C:\\temp\\testdir\\1\\2\\3' is skipped.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\deletethese1.tmp'.\nVERBOSE: Removing file 'C:\\temp\\testdir\\1\\2\\deletethese1.tmp' because it was modified more than 10000 ms ago and matches the specified name regex: '\\.tmp$'\n (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\deletethese2.tmp'.\nVERBOSE: Removing file 'C:\\temp\\testdir\\1\\2\\deletethese2.tmp' because it was modified more than 10000 ms ago and matches the specified name regex: '\\.tmp$'\n (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\deletethese3.tmp'.\nVERBOSE: Removing file 'C:\\temp\\testdir\\1\\2\\deletethese3.tmp' because it was modified more than 10000 ms ago and matches the specified name regex: '\\.tmp$'\n (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\keepThese1.log'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\1\\2\\keepThese1.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\keepThese2.log'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\1\\2\\keepThese2.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\2\\keepThese3.log'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\1\\2\\keepThese3.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: In foreach $TempTempPath processing path 'C:\\temp\\testdir\\1\\deletethese1.tmp'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\deletethese1.tmp'.\nVERBOSE: Removing file 'C:\\temp\\testdir\\1\\deletethese1.tmp' because it was modified more than 10000 ms ago and matches the specified name regex: '\\.tmp$' (\ndefault '.*').\nVERBOSE: In foreach $TempTempPath processing path 'C:\\temp\\testdir\\1\\deletethese2.tmp'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\deletethese2.tmp'.\nVERBOSE: Removing file 'C:\\temp\\testdir\\1\\deletethese2.tmp' because it was modified more than 10000 ms ago and matches the specified name regex: '\\.tmp$' (\ndefault '.*').\nVERBOSE: In foreach $TempTempPath processing path 'C:\\temp\\testdir\\1\\deletethese3.tmp'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\deletethese3.tmp'.\nVERBOSE: Removing file 'C:\\temp\\testdir\\1\\deletethese3.tmp' because it was modified more than 10000 ms ago and matches the specified name regex: '\\.tmp$' (\ndefault '.*').\nVERBOSE: In foreach $TempTempPath processing path 'C:\\temp\\testdir\\1\\keepThese1.log'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\keepThese1.log'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\1\\keepThese1.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: In foreach $TempTempPath processing path 'C:\\temp\\testdir\\1\\keepThese2.log'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\keepThese2.log'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\1\\keepThese2.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: In foreach $TempTempPath processing path 'C:\\temp\\testdir\\1\\keepThese3.log'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\1\\keepThese3.log'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\1\\keepThese3.log' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: In foreach $TempTempPath processing path 'C:\\temp\\testdir\\RandomData\\1.2'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\RandomData\\1.2'.\nVERBOSE: Processing first level directory with path: 'C:\\temp\\testdir\\RandomData\\1.2'.\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\RandomData\\1.2\\RandomData.psd1'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\RandomData\\1.2\\RandomData.psd1' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: in InnerProcessPath processing 'C:\\temp\\testdir\\RandomData\\1.2\\RandomData.psm1'.\nVERBOSE: Ignoring. File 'C:\\temp\\testdir\\RandomData\\1.2\\RandomData.psm1' does not match the specified name regex: '\\.tmp$' (default '.*').\nVERBOSE: Total processed path count was: 17\nVERBOSE: Attempted to delete 6 files.\n\nPS C:\\temp\\testdir\u003e \n```\n","funding_links":[],"categories":["PowerShell"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEliteLoser%2FRemoveOldFiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEliteLoser%2FRemoveOldFiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEliteLoser%2FRemoveOldFiles/lists"}