UI not updated with new scripts/schedules when added directly to config files

@adam I’m building out some automation which will automatically add new jobs from zip packages to UA. I know there is the API, but I’m looking at adding the scripts by adding lines to the config files themselves if at all possible. I am able to make the changes to the files, but it seems like the UI never updates with these new values.

If need be, I can use the API calls, but this seemed like a reasonable way to do things on the back end.

EDIT: I’m a dummy - was a syntax error in files.

That should work. There is a file system watcher that runs when changes are made to the files. Can you check the log to see if there are any errors reported during reload?

1 Like

You know what… I’m dumb. It was a bug of mine :man_facepalming: but the errors in the logs did reveal why it was failing. That said, I am still seeing that folders.ps1 error.

For anyone else who might find it useful, I’ve got this little function to force updates of the configuration files:

function Update-UniversalConfigs {
	param (
		$ServerUri,
        $AppToken
	)	
	$ConfigurationUri = '{0}/api/v1/configuration' -f $ServerUri
	Write-Output 'Updating Universal Config Files...'
	Invoke-RestMethod $ConfigurationUri -Method POST -Headers @{ Authorization = "Bearer $AppToken" }
	Write-Output 'DONE!'
}