List-HiddenFiles
Lists all hidden files in a directory tree
param([string]$path = "$PWD")
try {
$stopWatch = [system.diagnostics.stopwatch]::startNew()
$path = Resolve-Path "$path"
Write-Progress "Scanning $path for hidden files..."
[int]$count = 0
Get-ChildItem "$path" -attributes Hidden -recurse | Foreach-Object {
"??$($_.FullName)"
$count++
}
Write-Progress -completed " "
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
"? Found $count hidden files within ??$path in $elapsed sec"
exit 0 # success
} catch {
"?? ERROR: $($Error[0]) (script line $($_.InvocationInfo.ScriptLineNumber))"
exit 1
}Specifies the path to the directory tree (default is current working dir)