-
Notifications
You must be signed in to change notification settings - Fork 28
UpdateServicesServer, UpdateServicesApprovalRule: Fixing Products processing, verbose output #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is already in the Main branch - need to rebase? |
||
|
|
||
| $ApprovalRule = $WsusServer.GetInstallApprovalRules() | Where-Object -FilterScript { $_.Name -eq $Name } | ||
|
|
||
|
|
@@ -215,11 +215,14 @@ function Set-TargetResource | |
| $ApprovalRule.Save() | ||
|
|
||
| $ProductCollection = New-Object -TypeName Microsoft.UpdateServices.Administration.UpdateCategoryCollection | ||
| $AllWsusProducts = $WsusServer.GetUpdateCategories() | ||
| foreach ($Product in $Products) | ||
| { | ||
| if ($WsusProduct = Get-WsusProduct | Where-Object -FilterScript { $_.Product.Title -eq $Product }) | ||
| if ($WsusProduct = $AllWsusProducts | Where-Object -FilterScript { $_.Title -eq $Product }) | ||
| { | ||
| $ProductCollection.Add($WsusServer.GetUpdateCategory($WsusProduct.Product.Id)) | ||
| $WsusProduct | Foreach-Object { | ||
| $ProductCollection.Add($_) | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -121,7 +121,7 @@ function Get-TargetResource | |
| } | ||
| else | ||
| { | ||
| $Languages = $WsusConfiguration.GetEnabledUpdateLanguages() | ||
| $Languages = ($WsusConfiguration.GetEnabledUpdateLanguages()) -join ',' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs to be
As otherwise it's not returning a string array, but a single string joined by a comma |
||
| } | ||
|
|
||
| Write-Verbose -Message ($script:localizedData.WsusLanguages -f $Languages) | ||
|
|
@@ -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)) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change is already in the main branch - you may need to rebase? |
||
| { | ||
| if ($null -eq (Compare-Object -ReferenceObject ($Products | Sort-Object -Unique) -DifferenceObject ` | ||
| if ($null -eq (Compare-Object -ReferenceObject $Products -DifferenceObject ` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto - need to rebase |
||
| (($WsusServer.GetUpdateCategories().Title) | Sort-Object -Unique) -SyncWindow 0)) | ||
| { | ||
| $Products = @('*') | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to update CHANGELOG as some changes are already implemented