Rename to list-timezone.ps1

This commit is contained in:
Markus Fleschutz
2021-04-17 18:38:38 +02:00
parent 370fe6c7dc
commit 9aa997ebf5
6 changed files with 19 additions and 27 deletions

View File

@ -1,4 +1,4 @@
#!/usr/bin/pwsh
#!/usr/bin/pwsh
<#
.SYNTAX list-hidden-files.ps1 [<dir-tree>]
.DESCRIPTION lists hidden files within the given directory tree
@ -6,20 +6,17 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($DirTree = "")
if ($DirTree -eq "" ) {
$DirTree = read-host "Enter the path to the directory tree"
}
param($DirTree = "$PWD")
try {
$DirTree = resolve-path "$DirTree/"
[int]$Count = 0
write-progress "Listing hidden files in $DirTree ..."
get-childItem $DirTree -attributes Hidden -recurse | foreach-object {
write-output $_.FullName
get-childItem "$DirTree" -attributes Hidden -recurse | foreach-object {
"📄 $($_.FullName)"
$Count++
}
write-host -foregroundColor green "OK - found $Count hidden file(s)"
"✔️ directory tree $DirTree has $Count hidden file(s)"
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"