Skip to content

Conversation

gpotter2
Copy link
Contributor

@gpotter2 gpotter2 commented Sep 18, 2025

This allows to use this script in a scheduled task, to run all cleanup actions in one go.

e.g.

.\SUSDB-Maintenance.ps1 -Action RA -DontShowLogs -DaysSupersededNotDeclined 30

Currently the script uses Read-Host which requires user interaction.

This PR also:

  • fixes 'q' doing nothing

This allows to use this script in a scheduled task, to run all cleanup actions in one go.
Copy link

@gpotter2 : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change.

@gpotter2
Copy link
Contributor Author

#sign-off

Copy link

Invalid command: '#sign-off'. Only the assigned author of one or more file in this PR can sign off. @danschuh

Copy link

@gpotter2 : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change.

Copy link
Contributor

Learn Build status updates of commit d10a80c:

✅ Validation status: passed

File Status Preview URL Details
support/mem/configmgr/update-management/wsus-automatic-maintenance.md ✅Succeeded

For more details, please refer to the build report.

@rmca14
Copy link
Contributor

rmca14 commented Sep 22, 2025

@gpotter2 As noted in the PR UI, a stakeholder review is required. After their review is complete, sign off again. Thanks.

@rmca14
Copy link
Contributor

rmca14 commented Sep 26, 2025

@danschuh

@danschuh
Copy link
Contributor

danschuh commented Oct 1, 2025

Hello @gpotter2 Thank you for your contribution, I ran a few tests and found the following.

  • When executing with switches to run silent it executes a pause statement and never quits. I removed the pause on line 701 for further testing.

  • If executing from cmd line with switches and you leave off the parameter [int] $DaysSupersededNotDeclined, you will get the prompt for days to exclude if RA or 6 is selected. This should be a mandatory parameter with these two options or perhaps better just to document the requirement in the remarks.

  • Recommend examples of running with parameters in comments.

  • When running this from scheduled task with -Action RA -Dontshowlogs -DaysSupersededNotDeclined 180

  • log showed these two entries as though 30 days was set and not 180
Number of days entered :  30 , proceeding with cleaning up superseded updates.
Days specified: 30
  • Running interactively with the same cmdline I get this error returned in UI and log:
    Number of days entered [180] is invalid, must be between 1-99.

  • Tried again from task scheduler and changed the days to 98 to fall within the requirement and it is still showing "Number of days entered : 30"

@gpotter2
Copy link
Contributor Author

gpotter2 commented Oct 2, 2025

Thanks a lot for the feedback. I will test it more thoroughly using the examples you provided and fix the issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants