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

Update windows-update.ps1 #145

Closed
wants to merge 1 commit into from
Closed

Conversation

TheSleepingFox
Copy link

adding try-catch for LastDeploymentChangeTime with default to todays date.

adding try-catch for LastDeploymentChangeTime with default to todays date.
@TheSleepingFox
Copy link
Author

This shoud hopefully fix Issue #144
Unfortunately I don't have access to an environment with 'make' currently, so unable to compile and confirm.

@rgl
Copy link
Owner

rgl commented Jul 10, 2024

The stack trace from #144 points to https://github.com/rgl/packer-plugin-windows-update/blob/v0.16.0/update/windows-update.ps1#L190 but why is that LastDeploymentChangeTime $null at all?

Using the current date does not seem appropriate, as it varies. Using a static 1970-01-01 would be more appropriate to signal that something is odd with the date. Or even, make it $null or unknown.

@TheSleepingFox
Copy link
Author

TheSleepingFox commented Jul 10, 2024 via email

@markusheiliger
Copy link

To me it looks like the LastDeploymentChangeTime is only accessed to generate the update summary output. So moving on with the NULL value is maybe no dealbreaker (its just the output that looks a little bit strange). Especially for those folks (including me) who love and rely on this plugin as part of their image factory.

@jbne
Copy link

jbne commented Jul 10, 2024

Do we know if $update could be null at that point as well? Doesn't seem like the likely culprit, but the stack trace doesn't give an indication on which piece is null.

@rgl
Copy link
Owner

rgl commented Jul 10, 2024

$update or $update.LastDeploymentChangeTime being $null is quite strange. It seems something odd is happening elsewhere.

looking at the error in #144 (comment), it seems to infer that KB5007651 has some kind of problem.

by any change have you guys tried to install that KB5007651 manually (e.g. from the windows update app)? did it work?

@rgl
Copy link
Owner

rgl commented Jul 10, 2024

@rgl rgl closed this Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants