Skip to content

Instantly share code, notes, and snippets.

@jtuttas
Created March 13, 2013 11:06
Show Gist options
  • Save jtuttas/5151137 to your computer and use it in GitHub Desktop.
Save jtuttas/5151137 to your computer and use it in GitHub Desktop.
Die x größten Files finden
param (
[int]$num=5
)
cls
$a = Get-ChildItem -Recurse
$max = New-Object int[] $num
$maxNames = new-object String[] $num
foreach ($datei in $a) {
for ($i=0;$i -lt $num;$i++) {
if ($datei.Length -ge $max[$i]) {
$max[$i]=$datei.Length
$maxNames[$i]=$datei.Name
$i=$num
}
}
}
Write-Host "Die $num größten Programm sind:"
$maxNames
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment