Updated the Markdown manuals

This commit is contained in:
Markus Fleschutz
2023-12-07 20:24:45 +01:00
parent dafa6cf1d7
commit 1ffd91c5e2
605 changed files with 1927 additions and 1015 deletions

View File

@ -1,19 +1,19 @@
*list-empty-files.ps1*
================
This PowerShell script scans and lists all empty files within the given directory tree.
This PowerShell script scans a directory tree and lists all empty files.
Parameters
----------
```powershell
PS> ./list-empty-files.ps1 [[-DirTree] <String>] [<CommonParameters>]
PS> ./list-empty-files.ps1 [[-path] <String>] [<CommonParameters>]
-DirTree <String>
Specifies the path to the directory tree
-path <String>
Specifies the path to the directory tree (default is current working dir)
Required? false
Position? 1
Default value
Default value "$PWD"
Accept pipeline input? false
Accept wildcard characters? false
@ -25,7 +25,9 @@ PS> ./list-empty-files.ps1 [[-DirTree] <String>] [<CommonParameters>]
Example
-------
```powershell
PS> ./list-empty-files.ps1 C:\
PS> ./list-empty-files.ps1 C:\Windows
...
Found 6 empty files within C:\Windows in 54 sec
```
@ -42,32 +44,36 @@ Script Content
```powershell
<#
.SYNOPSIS
Lists empty files within a directory tree
Lists all empty files in a directory tree
.DESCRIPTION
This PowerShell script scans and lists all empty files within the given directory tree.
.PARAMETER DirTree
Specifies the path to the directory tree
This PowerShell script scans a directory tree and lists all empty files.
.PARAMETER path
Specifies the path to the directory tree (default is current working dir)
.EXAMPLE
PS> ./list-empty-files.ps1 C:\
PS> ./list-empty-files.ps1 C:\Windows
...
✔️ Found 6 empty files within C:\Windows in 54 sec
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
Author: Markus Fleschutz | License: CC0
#>
param([string]$DirTree = "")
param([string]$path = "$PWD")
try {
if ($DirTree -eq "" ) { $DirTree = read-host "Enter the path to the directory tree" }
$stopWatch = [system.diagnostics.stopwatch]::startNew()
[int]$Count = 0
write-progress "Listing empty files in $DirTree ..."
get-childItem $DirTree -attributes !Directory -recurse | where {$_.Length -eq 0} | foreach-object {
write-output $_.FullName
$Count++
$path = Resolve-Path "$path"
Write-Progress "Scanning $path for empty files..."
[int]$count = 0
Get-ChildItem $path -attributes !Directory -recurse | where {$_.Length -eq 0} | Foreach-Object {
"📄$($_.FullName)"
$count++
}
"✔️ found $Count empty file(s)"
Write-Progress -completed " "
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
"✔️ Found $count empty files within $path in $elapsed sec"
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
@ -75,4 +81,4 @@ try {
}
```
*(generated by convert-ps2md.ps1 using the comment-based help of list-empty-files.ps1 as of 10/19/2023 08:11:39)*
*(generated by convert-ps2md.ps1 using the comment-based help of list-empty-files.ps1 as of 12/07/2023 20:24:19)*