{"action":"created","issue":{"url":"https://api.github.com/repos/alanrenouf/vCheck-vSphere/issues/361","labels_url":"https://api.github.com/repos/alanrenouf/vCheck-vSphere/issues/361/labels{/name}","comments_url":"https://api.github.com/repos/alanrenouf/vCheck-vSphere/issues/361/comments","events_url":"https://api.github.com/repos/alanrenouf/vCheck-vSphere/issues/361/events","html_url":"https://github.com/alanrenouf/vCheck-vSphere/issues/361","id":68813245,"number":361,"title":"Proposal: Settings handling change","user":{"login":"Sneddo","id":1934596,"avatar_url":"https://avatars.githubusercontent.com/u/1934596?v=3","gravatar_id":"","url":"https://api.github.com/users/Sneddo","html_url":"https://github.com/Sneddo","followers_url":"https://api.github.com/users/Sneddo/followers","following_url":"https://api.github.com/users/Sneddo/following{/other_user}","gists_url":"https://api.github.com/users/Sneddo/gists{/gist_id}","starred_url":"https://api.github.com/users/Sneddo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sneddo/subscriptions","organizations_url":"https://api.github.com/users/Sneddo/orgs","repos_url":"https://api.github.com/users/Sneddo/repos","events_url":"https://api.github.com/users/Sneddo/events{/privacy}","received_events_url":"https://api.github.com/users/Sneddo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/alanrenouf/vCheck-vSphere/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/alanrenouf/vCheck-vSphere/milestones/2","html_url":"https://github.com/alanrenouf/vCheck-vSphere/milestones/7.0","labels_url":"https://api.github.com/repos/alanrenouf/vCheck-vSphere/milestones/2/labels","id":1079770,"number":2,"title":"7.0","description":"Next major release.\r\n\r\nPlanned changes to settings handling","creator":{"login":"Sneddo","id":1934596,"avatar_url":"https://avatars.githubusercontent.com/u/1934596?v=3","gravatar_id":"","url":"https://api.github.com/users/Sneddo","html_url":"https://github.com/Sneddo","followers_url":"https://api.github.com/users/Sneddo/followers","following_url":"https://api.github.com/users/Sneddo/following{/other_user}","gists_url":"https://api.github.com/users/Sneddo/gists{/gist_id}","starred_url":"https://api.github.com/users/Sneddo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sneddo/subscriptions","organizations_url":"https://api.github.com/users/Sneddo/orgs","repos_url":"https://api.github.com/users/Sneddo/repos","events_url":"https://api.github.com/users/Sneddo/events{/privacy}","received_events_url":"https://api.github.com/users/Sneddo/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2015-04-22T23:04:17Z","updated_at":"2015-04-22T23:04:27Z","due_on":null,"closed_at":null},"comments":8,"created_at":"2015-04-15T23:59:55Z","updated_at":"2015-04-27T22:38:04Z","closed_at":null,"body":"So, I feel like we are hitting the limitations of the current settings and plugin structures. For example the ease (or lack thereof) of updates and the sheer number of settings to be configured, even if irrelevant.\r\n\r\nWhat I've been considering is shifting the plugins from raw Powershell code, to an XML structure. This will greatly simplify the handling of settings, and remove the need to parse the text in the file.\r\n\r\ne.g.\r\n\r\n      <plugin>\r\n         <info>\r\n            <author>Author Name</author>\r\n            <version>1.0</version>\r\n            <category>vSphere</category>\r\n            <title>Plugin title</title>\r\n            <header>Plugin Header</header>\r\n            <comments>Plugin Comments</comments>\r\n            <display>Table</display>\r\n         </info>\r\n         <settings>\r\n            <setting name='examplesetting' prompt='Do you want to set this setting?'>$true</setting>\r\n            <setting name='settingdependancy' dependancy='$plugin.settings.examplesetting -eq $true' prompt='What value do you want to set?'>value</setting>\r\n         </settings>\r\n      \r\n         <code>\r\n            Write-Host \"Plugincode goes here\"\r\n         </code>\r\n      </plugin>\r\n\r\nDuring execution, vCheck would read a settings.xml file (probably a modified version of the existing job XML), which would contain any overrides for default settings (so if defined it is used, otherwise use the default from the plugin). This would mean that we are no longer modifying the plugin file with plugin-specific settings and allow us to update the plugin code with no risk of losing existing configuration.\r\n\r\nAs you can see, this also allows us to define dependencies on settings- so for example if we were to extend this to the GlobalVariables.ps1 file we could make SMTP settings dependant on $SendEmail being true. We could also wrap in the EndScript.ps1 as a post-execution step.\r\n\r\nThe downside is that internationalization for the settings prompt is not straight-forward (though this is not currently supported anyway). Perhaps having a 'prompts' key, with culture-specific subkeys?\r\n\r\nDue to the significant change, I'm proposing this as a 7.0 release, but keen to get some input on this. "},"comment":{"url":"https://api.github.com/repos/alanrenouf/vCheck-vSphere/issues/comments/96840318","html_url":"https://github.com/alanrenouf/vCheck-vSphere/issues/361#issuecomment-96840318","issue_url":"https://api.github.com/repos/alanrenouf/vCheck-vSphere/issues/361","id":96840318,"user":{"login":"Sneddo","id":1934596,"avatar_url":"https://avatars.githubusercontent.com/u/1934596?v=3","gravatar_id":"","url":"https://api.github.com/users/Sneddo","html_url":"https://github.com/Sneddo","followers_url":"https://api.github.com/users/Sneddo/followers","following_url":"https://api.github.com/users/Sneddo/following{/other_user}","gists_url":"https://api.github.com/users/Sneddo/gists{/gist_id}","starred_url":"https://api.github.com/users/Sneddo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sneddo/subscriptions","organizations_url":"https://api.github.com/users/Sneddo/orgs","repos_url":"https://api.github.com/users/Sneddo/repos","events_url":"https://api.github.com/users/Sneddo/events{/privacy}","received_events_url":"https://api.github.com/users/Sneddo/received_events","type":"User","site_admin":false},"created_at":"2015-04-27T22:38:04Z","updated_at":"2015-04-27T22:38:04Z","body":"Yep, I was working on a proof of concept config GUI that I posted about in Issue #270.\r\n\r\nI've since changed jobs and not had much spare time to work on it, and then I just forgot about it :(\r\nhttps://github.com/Sneddo/vCheck-Tools\r\n\r\nIf you have spare time, it would be much appreciated. Probably worth creating a feature branch for it and merging into the vCheck repo (will actually do that now)...feel free to use or scrap any of it if you have time to work on it, as I said it was more of a proof of concept than anything."}}