File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 11<#
22. SYNOPSIS
3- Lists all empty directories in a directory tree
3+ Lists empty directories in a directory tree
44. DESCRIPTION
55 This PowerShell script scans a directory tree and lists all empty directories.
66. PARAMETER path
77 Specifies the path to the directory tree (current working directory by default)
88. EXAMPLE
99 PS> ./list-empty-dirs.ps1 C:\Windows
1010 ...
11- ✅ Found 39972 empty directories within 📂C:\Windows in 222 sec
11+ ✅ Found 39972 empty directories within 📂C:\Windows in 222s.
1212. LINK
1313 https://github.com/fleschutz/PowerShell
1414. NOTES
2828 $count ++
2929 }
3030 Write-Progress - completed " "
31- [int ]$Elapsed = $stopWatch.Elapsed.TotalSeconds
32- " ✅ Found $count empty directories within 📂$path in $elapsed sec "
31+ [int ]$elapsed = $stopWatch.Elapsed.TotalSeconds
32+ " ✅ Found $count empty directories within 📂$path in $ ( $ elapsed) s. "
3333 exit 0 # success
3434} catch {
3535 " ⚠️ Error in line $ ( $_.InvocationInfo.ScriptLineNumber ) : $ ( $Error [0 ]) "
Original file line number Diff line number Diff line change 11<#
22. SYNOPSIS
3- Lists all read-only files in a directory tree
3+ Lists read-only files in a directory tree
44. DESCRIPTION
55 This PowerShell script scans a directory tree and lists all read-only files.
66. PARAMETER path
77 Specifies the path to the directory tree (current working dir by default)
88. EXAMPLE
99 PS> ./list-read-only-files.ps1 C:\Windows
1010 ...
11- ✅ Found 107 read-only files within 📂C:\Windows in 50 sec
11+ ✅ Found 107 read-only files within 📂C:\Windows in 50s.
1212. LINK
1313 https://github.com/fleschutz/PowerShell
1414. NOTES
2929 }
3030 Write-Progress - completed " "
3131 [int ]$elapsed = $stopWatch.Elapsed.TotalSeconds
32- " ✅ Found $count read-only files within 📂$path in $elapsed sec "
32+ " ✅ Found $count read-only files within 📂$path in $ ( $ elapsed) s. "
3333 exit 0 # success
3434} catch {
3535 " ⚠️ Error in line $ ( $_.InvocationInfo.ScriptLineNumber ) : $ ( $Error [0 ]) "
Original file line number Diff line number Diff line change 88. EXAMPLE
99 PS> ./list-system-files.ps1 C:\Windows
1010 ...
11- ✅ Found 764 system files within 📂C:\windows in 50 sec
11+ ✅ Found 764 system files within 📂C:\windows in 50s.
1212. LINK
1313 https://github.com/fleschutz/PowerShell
1414. NOTES
2929 }
3030 Write-Progress - completed " "
3131 [int ]$elapsed = $stopWatch.Elapsed.TotalSeconds
32- " ✅ Found $count system files within 📂$path in $elapsed sec "
32+ " ✅ Found $count system files within 📂$path in $ ( $ elapsed) s. "
3333 exit 0 # success
3434} catch {
3535 " ⚠️ Error in line $ ( $_.InvocationInfo.ScriptLineNumber ) : $ ( $Error [0 ]) "
You can’t perform that action at this time.
0 commit comments