From 1c08eadff332df2d8bb06c0c0ca54a97915af93f Mon Sep 17 00:00:00 2001 From: EdTheDev Date: Wed, 31 Mar 2021 22:07:37 -0500 Subject: [PATCH] Attempt to add meaningless status ticker to function --- psmodules/drivespace.psm1 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/psmodules/drivespace.psm1 b/psmodules/drivespace.psm1 index 47527c3..fc5c011 100644 --- a/psmodules/drivespace.psm1 +++ b/psmodules/drivespace.psm1 @@ -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 -- 2.47.3