X-Git-Url: https://us-delaporte.pagekite.me/gitweb/dotfiles.git/blobdiff_plain/1c08eadff332df2d8bb06c0c0ca54a97915af93f..d2ca7d9e0c86b833cb4f1bd90cc248ce6f2e6f71:/psmodules/drivespace.psm1 diff --git a/psmodules/drivespace.psm1 b/psmodules/drivespace.psm1 index fc5c011..342311b 100644 --- a/psmodules/drivespace.psm1 +++ b/psmodules/drivespace.psm1 @@ -5,7 +5,10 @@ Find 10 largest files on the C drive. #> function Show-LargeFiles() { - Get-ChildItem c:\ -r| sort -descending -property length | select -first 10 name, Length, FullName + param( + [int]$Max=10 + ) + Get-ChildItem c:\ -r| sort -descending -property length | select -first $Max name, Length, FullName } <# @@ -22,7 +25,7 @@ function Show-Drivespace() { } function Show-DrivespacePretty() { - Start-Job -Name "FileCollection" -ScriptBlock {Show-Drivespace() } + Start-Job -Name "FileCollection" -ScriptBlock { Show-Drivespace } While((Get-Job -Name "FileCollection").State -eq "Running") { Write-Progress -Activity "Collecting Files..." -PercentComplete $x If($x -eq 100){ @@ -38,5 +41,4 @@ Get-Job -Name "FileCollection" | Remove-Job } Export-ModuleMember -Function Show-Drivespace -Export-ModuleMember -Function Show-DrivespacePretty Export-ModuleMember -Function Show-LargeFiles