]> us-delaporte.pagekite.me Git - dotfiles.git/blobdiff - psmodules/drivespace.psm1
Use `files` path to PowerShell profile
[dotfiles.git] / psmodules / drivespace.psm1
index fc5c0114af82100713d79bb2ea5171511fcbec4f..342311bc046775948a86b3544079365a319f57be 100644 (file)
@@ -5,7 +5,10 @@ Find 10 largest files on the C drive.
 
 #>
 function Show-LargeFiles() {
 
 #>
 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() {
 }
 
 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){
 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-Drivespace 
-Export-ModuleMember -Function Show-DrivespacePretty
 Export-ModuleMember -Function Show-LargeFiles
 Export-ModuleMember -Function Show-LargeFiles