Hey!
I’m looking to restrict access in our instance to the admin portal and mostly have everything defined in code, I’m also employing some dynamic logic in Schedules.ps1 which has an IF statement, based on the hostname of the box it’s running on to define schedules or not (I’m using one codebase for 2 servers).
One challenge with this approach is that when I add a new schedule to the schedule.ps1 script, it’s not automatically picked up, even after 24hrs.
I’ve tried running Sync-PSUConfiguration but also this doesnt seem to re-import the schedules.ps1, which then leaves my only option to either restart the PSU service or reboot the server. Is there any command or way to refresh schedules defined in this file if it’s updated outside the GUI?
Sync-PSUConfiguration should be doing what you are looking for. The file system watcher should also be picking up changes if you have it enabled.
Are you writing these files manually or with some automated process? I would recommend bumping up the system log to Debug, attempting a change and then checking for the notification in the log. It should state every time it thinks a file is touched.
Also, does this happen with other files or just schedules.ps1?
Thanks! I’ll give that a go and try figure out what’s going on. It works if I update my scripts outside the GUI just not schedules, I haven’t tested it with anything else though.
I believe I’ve got the file system watcher disabled as I didn’t want changes to auto apply to my apps or for them to restart.
I’m updating these files directly via vscode at the moment, just manual saves. No automated process just yet but eventually it’ll be via pull requests in prod and manual in dev