Skip to content

Commit a508a40

Browse files
committed
fixed Get-WsusUpdateSelfContainedFile not returning locally stored update files
1 parent ad1e1ed commit a508a40

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

wimau/wimau.psd1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Micah Hunsberger
55
#
6-
# Generated on: 10/6/2025
6+
# Generated on: 10/7/2025
77
#
88

99
@{
@@ -12,7 +12,7 @@
1212
RootModule = 'wimau.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '1.0.0.1'
15+
ModuleVersion = '1.0.1.0'
1616

1717
# Supported PSEditions
1818
# CompatiblePSEditions = @()
@@ -118,11 +118,11 @@ PrivateData = @{
118118
RequireLicenseAcceptance = $false
119119

120120
# External dependent modules of this module
121-
ExternalModuleDependencies = @('DISM', 'UpdateServices')
121+
ExternalModuleDependencies = @('DISM','UpdateServices')
122122

123123
} # End of PSData hashtable
124124

125-
} # End of PrivateData hashtable
125+
} # End of PrivateData hashtable
126126

127127
# HelpInfo URI of this module
128128
# HelpInfoURI = ''

wimau/wimau.psm1

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)