Created
March 13, 2013 11:06
-
-
Save jtuttas/5151137 to your computer and use it in GitHub Desktop.
Die x größten Files finden
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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