Skip to content
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

xWindowsUpdateAgent: Improve the UpdateNow parameter description #77

Open
ewhitesides opened this issue Jun 8, 2018 · 1 comment
Open
Labels
documentation The issue is related to documentation only. help wanted The issue is up for grabs for anyone in the community.

Comments

@ewhitesides
Copy link

ewhitesides commented Jun 8, 2018

Also, it would be helpful to state the long term behavior in the Readme :

if I apply a configuration with UpdateNow = $true, will the server

-continue to apply updates after the initial set-dscconfiguration based on what the LCM mode is.
-report errors in the future in the DSC Operational Logs if there are new available updates?

@johlju
Copy link
Member

johlju commented Jun 9, 2018

Looking at the code it seems like this to me:

Updated text and removed errors.

Get-TargetResource

If UpdateNow is set to $true, Get-TargetResource will check how many updates there are to install and return that in TotalUpdatesNotInstalled. Get-TargetResource will return $true for UpdateNow if there zero updates and no reboot is required, otherwise Get-TargetResource returns $false. Logic here seems off?

https://github.com/PowerShell/xWindowsUpdate/blob/1afc7a4a45c7eea5e46a01e562860b050b58aa27/DscResources/MSFT_xWindowsUpdateAgent/MSFT_xWindowsUpdateAgent.psm1#L361-L375

Test-TargetResource

If UpdateNow is set to $true, and Get-TargetResource returns UpdateNow = $true, Test-TargetResource returns $true, otherwise Test-TargetResource returns $false. This is why the logic seems of in Get-TargetResource, feels like Test-TargetResource has reversed logic.

https://github.com/PowerShell/xWindowsUpdate/blob/1afc7a4a45c7eea5e46a01e562860b050b58aa27/DscResources/MSFT_xWindowsUpdateAgent/MSFT_xWindowsUpdateAgent.psm1#L548-L561

Set-TargetResource

Same logic as in Test-TargetResource.

https://github.com/PowerShell/xWindowsUpdate/blob/1afc7a4a45c7eea5e46a01e562860b050b58aa27/DscResources/MSFT_xWindowsUpdateAgent/MSFT_xWindowsUpdateAgent.psm1#L440-L464

Summary

I think it should (meant to) continuously update as long as Get-WuaSearcher returns that there are updates to be installed.

@johlju johlju added help wanted The issue is up for grabs for anyone in the community. documentation The issue is related to documentation only. labels Jun 9, 2018
@johlju johlju changed the title Clarification Needed 2 xWindowsUpdateAgent: Improve the UpdateNow parameter description Jun 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation The issue is related to documentation only. help wanted The issue is up for grabs for anyone in the community.
Projects
None yet
Development

No branches or pull requests

2 participants