mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-06-08 22:16:38 +02:00
Updated some scripts
This commit is contained in:
parent
81f89c9484
commit
476ce9544f
@ -1,6 +1,6 @@
|
|||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Lists all empty directories in a directory tree
|
Lists empty directories in a directory tree
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This PowerShell script scans a directory tree and lists all empty directories.
|
This PowerShell script scans a directory tree and lists all empty directories.
|
||||||
.PARAMETER path
|
.PARAMETER path
|
||||||
@ -8,7 +8,7 @@
|
|||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./list-empty-dirs.ps1 C:\Windows
|
PS> ./list-empty-dirs.ps1 C:\Windows
|
||||||
...
|
...
|
||||||
✅ Found 39972 empty directories within 📂C:\Windows in 222 sec
|
✅ Found 39972 empty directories within 📂C:\Windows in 222s.
|
||||||
.LINK
|
.LINK
|
||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
.NOTES
|
.NOTES
|
||||||
@ -28,8 +28,8 @@ try {
|
|||||||
$count++
|
$count++
|
||||||
}
|
}
|
||||||
Write-Progress -completed " "
|
Write-Progress -completed " "
|
||||||
[int]$Elapsed = $stopWatch.Elapsed.TotalSeconds
|
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
|
||||||
"✅ Found $count empty directories within 📂$path in $elapsed sec"
|
"✅ Found $count empty directories within 📂$path in $($elapsed)s."
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Lists all read-only files in a directory tree
|
Lists read-only files in a directory tree
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This PowerShell script scans a directory tree and lists all read-only files.
|
This PowerShell script scans a directory tree and lists all read-only files.
|
||||||
.PARAMETER path
|
.PARAMETER path
|
||||||
@ -8,7 +8,7 @@
|
|||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./list-read-only-files.ps1 C:\Windows
|
PS> ./list-read-only-files.ps1 C:\Windows
|
||||||
...
|
...
|
||||||
✅ Found 107 read-only files within 📂C:\Windows in 50 sec
|
✅ Found 107 read-only files within 📂C:\Windows in 50s.
|
||||||
.LINK
|
.LINK
|
||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
.NOTES
|
.NOTES
|
||||||
@ -29,7 +29,7 @@ try {
|
|||||||
}
|
}
|
||||||
Write-Progress -completed " "
|
Write-Progress -completed " "
|
||||||
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
|
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
|
||||||
"✅ Found $count read-only files within 📂$path in $elapsed sec"
|
"✅ Found $count read-only files within 📂$path in $($elapsed)s."
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./list-system-files.ps1 C:\Windows
|
PS> ./list-system-files.ps1 C:\Windows
|
||||||
...
|
...
|
||||||
✅ Found 764 system files within 📂C:\windows in 50 sec
|
✅ Found 764 system files within 📂C:\windows in 50s.
|
||||||
.LINK
|
.LINK
|
||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
.NOTES
|
.NOTES
|
||||||
@ -29,7 +29,7 @@ try {
|
|||||||
}
|
}
|
||||||
Write-Progress -completed " "
|
Write-Progress -completed " "
|
||||||
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
|
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
|
||||||
"✅ Found $count system files within 📂$path in $elapsed sec"
|
"✅ Found $count system files within 📂$path in $($elapsed)s."
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user