]> us-delaporte.pagekite.me Git - dotfiles.git/blobdiff - psmodules/drivespace.psm1
Fix for rm command
[dotfiles.git] / psmodules / drivespace.psm1
index 47072d89ea1cd45efc6bc1c4e321cddaa0549eb7..361ee23d6eda38ba78afd264685f5804f85ec5a5 100644 (file)
@@ -15,8 +15,28 @@ Display the free space on the C drive.
 
 #>
 function Show-Drivespace() {
 
 #>
 function Show-Drivespace() {
-       Get-PSDrive C | Select-Object Used,Free
+       Get-PSDrive C | Select-Object Used,Free | ForEach {
+               Write-Host "Free space GB: " ($_.Free / 1GB)
+               Write-Host "Used space GB: " ($_.Used / 1GB)
+       }
+}
+
+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-Drivespace 
+Export-ModuleMember -Function Show-DrivespacePretty
 Export-ModuleMember -Function Show-LargeFiles
 Export-ModuleMember -Function Show-LargeFiles