@@ -399,7 +399,7 @@ function Get-WsusUpdateSelfContainedFile {
399399 - PercentComplete (100 * ($i / $WsusUpdate.Length ))
400400
401401 $updateServerConfiguration = $currentUpdate.UpdateServer.GetConfiguration ()
402- $localContentCachePath = $updateServerConfiguration
402+ $localContentCachePath = $updateServerConfiguration.LocalContentCachePath
403403 $currentUpdate.GetInstallableItems ().Files | Where-Object {
404404 ($_.Type -eq [Microsoft.UpdateServices.Administration.FileType ]::SelfContained) -and `
405405 ($_.FileUri -match ' [cab|msu]$' )
@@ -419,21 +419,21 @@ function Get-WsusUpdateSelfContainedFile {
419419 $downloadSkipped = $true
420420 }
421421 } # else it is cached already
422+ }
422423
423- if (Test-Path - Path $updateFilePath ) {
424- [PSCustomObject ]@ {
425- Path = $updateFilePath
426- Title = $currentUpdate.Title
427- Product = $currentUpdate.ProductTitles
428- }
429- }
430- elseif ($downloadSkipped ) {
431- Write-Warning - Message " $ ( $currentUpdate.Title ) - User skipped download of $ ( $_.FileUri ) "
432- }
433- else {
434- Write-Error - Message " $ ( $currentUpdate.Title ) - Cannot find installable item at $updateFilePath ."
424+ if (Test-Path - Path $updateFilePath ) {
425+ [PSCustomObject ]@ {
426+ Path = $updateFilePath
427+ Title = $currentUpdate.Title
428+ Product = $currentUpdate.ProductTitles
435429 }
436430 }
431+ elseif ($downloadSkipped ) {
432+ Write-Warning - Message " $ ( $currentUpdate.Title ) - User skipped download of $ ( $_.FileUri ) "
433+ }
434+ else {
435+ Write-Error - Message " $ ( $currentUpdate.Title ) - Cannot find installable item at $updateFilePath ."
436+ }
437437 }
438438 }
439439 Write-Progress - Activity ' Get-WsusUpdateSelfContainedFile' `
0 commit comments