Skip to content

Commit

Permalink
Fix issue #62 and #63, fix verbose message
Browse files Browse the repository at this point in the history
and type variable
  • Loading branch information
NicolasBn authored and gaelcolas committed Feb 6, 2023
1 parent e92798d commit 182366e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
multiple products dor the same `Title`.
- Fix issue #58 and #66, with removed `-ErrorRecord` parameter on `New-InvalidResultException`
because `$_` not contain an exception.
- Fix issue [#62](https://github.com/dsccommunity/UpdateServicesDsc/issues/62),
Fixed verbose output of Languages in UpdateServiceServer
- Fix issue [#63](https://github.com/dsccommunity/UpdateServicesDsc/issues/63),
Fixed verbose output of WSUS server in UpdateServicesApprovalRule

## [1.2.0] - 2020-05-18

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function Get-TargetResource

if ($null -ne $WsusServer)
{
Write-Verbose -Message ('Identified WSUS server information: {0}' -f $WsusServer)
Write-Verbose -Message ('Identified WSUS server information: {0}' -f $WsusServer.Name)

$ApprovalRule = $WsusServer.GetInstallApprovalRules() | Where-Object -FilterScript { $_.Name -eq $Name }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function Get-TargetResource
}
else
{
$Languages = $WsusConfiguration.GetEnabledUpdateLanguages()
$Languages = ($WsusConfiguration.GetEnabledUpdateLanguages()) -join ','
}

Write-Verbose -Message ($script:localizedData.WsusLanguages -f $Languages)
Expand All @@ -141,9 +141,9 @@ function Get-TargetResource

Write-Verbose -Message ($script:localizedData.WsusClassifications -f $Classifications)
Write-Verbose -Message $script:localizedData.GettingWsusProducts
if ($Products = @($WsusSubscription.GetUpdateCategories().Title))
if ($Products = @($WsusSubscription.GetUpdateCategories().Title) | Sort-Object -Unique)
{
if ($null -eq (Compare-Object -ReferenceObject ($Products | Sort-Object -Unique) -DifferenceObject `
if ($null -eq (Compare-Object -ReferenceObject $Products -DifferenceObject `
(($WsusServer.GetUpdateCategories().Title) | Sort-Object -Unique) -SyncWindow 0))
{
$Products = @('*')
Expand Down Expand Up @@ -581,9 +581,9 @@ if ($WsusConfiguration.OobeInitialized)
# All Products
'*' {
Write-Verbose -Message $script:localizedData.ConfiguringAllProducts
foreach ($Prdct in $AllWsusProducts)
foreach ($prdct in $AllWsusProducts)
{
$null = $productCollection.Add($WsusServer.GetUpdateCategory($Prdct.Id))
$null = $productCollection.Add($WsusServer.GetUpdateCategory($prdct.Id))
}
continue
}
Expand Down

0 comments on commit 182366e

Please sign in to comment.