mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-12 14:07:20 +02:00
Rename to list-timezone.ps1
This commit is contained in:
@ -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])"
|
||||
|
Reference in New Issue
Block a user