]> apps.delaporte.us Git - dotfiles.git/blobdiff - psmodules/drivespace.psm1
Merge branch 'master' of github.com:edthedev/dotfiles
[dotfiles.git] / psmodules / drivespace.psm1
index 47527c35ea911ff1e71e3a2784575dc444d09d15..fc5c0114af82100713d79bb2ea5171511fcbec4f 100644 (file)
@@ -21,5 +21,22 @@ function Show-Drivespace() {
        }
 }
 
+function Show-DrivespacePretty() {
+       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){
+               $x = 1
+       }
+       Else{
+               $x += 1
+       }
+}
+Write-Progress -Activity "Collecting Files..." -Completed
+$Files = Get-Job -Name "FileCollection" | Receive-Job
+Get-Job -Name "FileCollection" | Remove-Job
+}
+
 Export-ModuleMember -Function Show-Drivespace 
+Export-ModuleMember -Function Show-DrivespacePretty
 Export-ModuleMember -Function Show-LargeFiles