PowerShell-Profile/functions/Get-ObjectCount.ps1
Tomasz Kostrzewa 566c2a3e97 renamed: functions/Get-FileSize -> functions/Get-FileSize.ps1
renamed:    functions/Get-FileSize copy -> functions/Get-ObjectCount.ps1
2024-03-05 23:07:11 +01:00

21 lines
422 B
PowerShell

# gitea.RdzeN.net
#
# Get Object Count.
function Get-ObjectCount {
param (
[string]$Path,
[switch]$Recurse
)
$items = Get-ChildItem $Path -Recurse:$Recurse
$count = $items.Count
return $count
}
if ($Recurse) {
Write-Host "Liczba obiektów w katalogu '$folderPath' i podkatalogach: $objectCount"
} else {
Write-Host "Liczba obiektów w katalogu '$folderPath': $objectCount"
}