Skip to content

Conversation

@tristancurtis97
Copy link

Proposed Changes

"Day of Week" feature. This allows you to specify the day of the week updates are run on using the Weekly or Bi-Weekly policy. If the Weekly or Bi-Weekly policy is selected, the policy script will check the DayofWeek registry value and update the schedule task appropriately. I also updated the ADMX and both English and French ADML files to allow for the new change.

Related Issues

(Github link to related issues or pull requests)

</policy>
<policy name="DayofWeek_Enable" class="Machine" displayName="$(string.DayofWeek_Name)" explainText="$(string.DayofWeek_Explain)" key="Software\Policies\Romanitho\Winget-AutoUpdate" presentation="$(presentation.DayofWeek)">
<parentCategory ref="WAU"/>
<supportedOn ref="WAU:SUPPORTED_WAU_1_16_0"/>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

supported version shout be the next one?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to 1_16_5, is that correct?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You will need to enter the version starting with when this Feature has been supported. So for me it should be: SUPPORTED_WAU_2_4_0

}
}
elseif ($WAUConfig.WAU_UpdatesInterval -eq "Monthly") {
$tasktriggers += New-ScheduledTaskTrigger -Weekly -At $WAUConfig.WAU_UpdatesAtTime -DaysOfWeek 2 -WeeksInterval 4
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could it be also possible to choose the day for a "monthly" as well?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway, for the monthly trigger, I need to review it to make it more accurate than just running every 4 weeks.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked into it, and you can do it utilizing schtasks.exe, but i noticed anti malware software does not like that, so hopefully someone other than me can come up with a solution, as I would love to be able to choose what day of the month the updates run on.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated this to use the dayofweek in the monthy selection as well.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@KnifMelti
Copy link
Contributor

Don't forget to increase the revisions of the files in the headers so that the files are actually imported correctly in AD!
ADMX right now: revision="4.9"
ADML right now: revision="4.8"

@Romanitho Romanitho changed the base branch from main to develop February 22, 2025 22:19
</policy>
<policy name="DayofWeek_Enable" class="Machine" displayName="$(string.DayofWeek_Name)" explainText="$(string.DayofWeek_Explain)" key="Software\Policies\Romanitho\Winget-AutoUpdate" presentation="$(presentation.DayofWeek)">
<parentCategory ref="WAU"/>
<supportedOn ref="WAU:SUPPORTED_WAU_1_16_5"/>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the next WAU version should be here, @KnifMelti?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ADMX/ADML is a mess to handle.
The one proposed is already in the header of ADMX and introducing something new must be mirrored in those strings:

  <supportedOn>
    <definitions>
      <definition name="SUPPORTED_WAU_1_16_0" displayName="$(string.SUPPORTED_WAU_1_16_0)" />
      <definition name="SUPPORTED_WAU_1_16_5" displayName="$(string.SUPPORTED_WAU_1_16_5)" />
      <definition name="SUPPORTED_WAU_EXPERIMENTAL"
        displayName="$(string.SUPPORTED_WAU_EXPERIMENTAL)" />
    </definitions>
  </supportedOn>
  <categories>
    <category displayName="$(string.WAU)" name="WAU" />
    <category name="Experimental" displayName="$(string.WAUEX)">
      <parentCategory ref="WAU" />
    </category>
  </categories>

ADML(en-US):

      <string id="WAU">Winget-AutoUpdate</string>
      <string id="WAUEX">Experimental</string>
      <string id="SUPPORTED_WAU_1_16_0">Winget-AutoUpdate version 1.16.0 or later</string>
      <string id="SUPPORTED_WAU_1_16_5">Winget-AutoUpdate version 1.16.5 or later</string>
      <string id="SUPPORTED_WAU_EXPERIMENTAL">Winget-AutoUpdate Experimental, subject to change, do
        not use on PROD</string>

ADML(fr-FR):

      <string id="WAU">Winget-AutoUpdate</string>
      <string id="WAUEX">Expérimental</string>
      <string id="SUPPORTED_WAU_1_16_0">Winget-AutoUpdate version 1.16.0 ou ultérieure</string>
      <string id="SUPPORTED_WAU_1_16_5">Winget-AutoUpdate version 1.16.5 ou ultérieure</string>
      <string id="SUPPORTED_WAU_EXPERIMENTAL">Winget-AutoUpdate Expérimental, sujet à changements,
        ne pas utiliser en PROD</string>

@KnifMelti
Copy link
Contributor

And.. ..evrytime the files are ment to be imported into AD the revisions must be increased if there's been a change in them.
Meaning that in this case I would increase both the ADMX and the ADML to for example revision="5.0"

@KnifMelti
Copy link
Contributor

KnifMelti commented Feb 23, 2025

If I may elaborate on this, I don't understand why there is a second WAU.adml (fr-FR) at all. It only complicates synchronization. I have not encountered anyone with a localized Domain Controller (DC) in their Active Directory; it is always en-US (when seeking help online, searching for GPO settings, troubleshooting, etc.). Who will translate the ADML files and keep them synchronized?

@Romanitho
Copy link
Owner

I agree. It will be harder to maintain. Google Translate or ChatGPT can help administrators if necessary 😅

@Romanitho Romanitho deleted the branch Romanitho:develop March 14, 2025 12:01
@Romanitho Romanitho closed this Mar 14, 2025
@nortonrome
Copy link

Sorry I don't get the issue here. Is there another PR coming or did you run into an issue that makes it impossible for now to implement the day of the week feature? :)

@Romanitho Romanitho reopened this Mar 25, 2025
@Romanitho
Copy link
Owner

I mistakenly removed the dev branch a few weeks ago. All PRs were force-closed. Sorry about that! :)

@Romanitho
Copy link
Owner

by the way, the branch is protected now even for me 😇

@nortonrome
Copy link

Is there any update on this? :) We would love to set our updates to Friday.

@Romanitho
Copy link
Owner

Yes, feel free to update your changes or open a new PR, as there are many conflicts :)

@KnifMelti
Copy link
Contributor

@tristancurtis97

@Romanitho
Copy link
Owner

yep, sorry 😅

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.

5 participants