Skip to content

Commit bf7e047

Browse files
UbuntuUbuntu
authored andcommitted
Cleanup Verbose
1 parent 30d81cc commit bf7e047

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

ModuleFast.ps1

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ function Install-ModuleFastHelper {
461461
Module = $module
462462
DownloadPath = Join-Path $ModuleCache "$($module.Name).$($module.Version).nupkg"
463463
}
464-
Write-Verbose "$module`: Downloading from $($module.DownloadLink)"
464+
Write-Verbose "$module`: Starting Download for $($module.DownloadLink)"
465465
if (-not $module.DownloadLink) {
466466
throw "$module`: No Download Link found. This is a bug"
467467
}
@@ -483,13 +483,14 @@ function Install-ModuleFastHelper {
483483
#We are going to extract these straight out of memory, so we don't need to write the nupkg to disk
484484

485485
$installPath = Join-Path $Destination $context.Module.Name $context.Module.Version
486-
Write-Verbose "Starting Extract Job $($context.Module) to $installPath"
486+
Write-Verbose "$($context.Module): Starting Extract Job to $installPath"
487487
# This is a sync process and we want to do it in parallel, hence the threadjob
488488
$installJob = Start-ThreadJob -ThrottleLimit 8 {
489489
$zip = [IO.Compression.ZipArchive]::new($USING:stream, 'Read')
490490
[IO.Compression.ZipFileExtensions]::ExtractToDirectory($zip, $USING:installPath)
491491
($zip).Dispose()
492492
($USING:stream).Dispose()
493+
return ($USING:context).Module
493494
}
494495
$installJobs.Add($installJob)
495496
}
@@ -499,9 +500,10 @@ function Install-ModuleFastHelper {
499500
while ($installJobs.count -gt 0) {
500501
$ErrorActionPreference = 'Stop'
501502
$completedJob = $installJobs | Wait-Job -Any
502-
$completedJob | Receive-Job -Wait -AutoRemoveJob
503+
$installedModule = $completedJob | Receive-Job -Wait -AutoRemoveJob
503504
if (-not $installJobs.Remove($completedJob)) { throw 'Could not remove completed job from list. This is a bug, report it' }
504505
$installed++
506+
Write-Verbose "$installedModule`: Successfuly installed to $installPath"
505507
Write-Progress -Id $installProgressId -ParentId 1 -Activity 'Install' -Status "$installed/$($ModuleToInstall.count) Modules" -PercentComplete ($installed / $ModuleToInstall.count * 100)
506508
}
507509

0 commit comments

Comments
 (0)