{"action":"created","issue":{"url":"https://api.github.com/repos/PowerShell/PSScriptAnalyzer/issues/196","labels_url":"https://api.github.com/repos/PowerShell/PSScriptAnalyzer/issues/196/labels{/name}","comments_url":"https://api.github.com/repos/PowerShell/PSScriptAnalyzer/issues/196/comments","events_url":"https://api.github.com/repos/PowerShell/PSScriptAnalyzer/issues/196/events","html_url":"https://github.com/PowerShell/PSScriptAnalyzer/issues/196","id":79558265,"number":196,"title":"Invoke-ScriptAnalyzer outputs a warning on manifests that use ModuleToProcess","user":{"login":"KirkMunro","id":3515485,"avatar_url":"https://avatars.githubusercontent.com/u/3515485?v=3","gravatar_id":"","url":"https://api.github.com/users/KirkMunro","html_url":"https://github.com/KirkMunro","followers_url":"https://api.github.com/users/KirkMunro/followers","following_url":"https://api.github.com/users/KirkMunro/following{/other_user}","gists_url":"https://api.github.com/users/KirkMunro/gists{/gist_id}","starred_url":"https://api.github.com/users/KirkMunro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KirkMunro/subscriptions","organizations_url":"https://api.github.com/users/KirkMunro/orgs","repos_url":"https://api.github.com/users/KirkMunro/repos","events_url":"https://api.github.com/users/KirkMunro/events{/privacy}","received_events_url":"https://api.github.com/users/KirkMunro/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/PowerShell/PSScriptAnalyzer/labels/Discussion","name":"Discussion","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/PowerShell/PSScriptAnalyzer/milestones/1","html_url":"https://github.com/PowerShell/PSScriptAnalyzer/milestones/1505","labels_url":"https://api.github.com/repos/PowerShell/PSScriptAnalyzer/milestones/1/labels","id":1086841,"number":1,"title":"1505","description":null,"creator":{"login":"raghushantha","id":11727200,"avatar_url":"https://avatars.githubusercontent.com/u/11727200?v=3","gravatar_id":"","url":"https://api.github.com/users/raghushantha","html_url":"https://github.com/raghushantha","followers_url":"https://api.github.com/users/raghushantha/followers","following_url":"https://api.github.com/users/raghushantha/following{/other_user}","gists_url":"https://api.github.com/users/raghushantha/gists{/gist_id}","starred_url":"https://api.github.com/users/raghushantha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raghushantha/subscriptions","organizations_url":"https://api.github.com/users/raghushantha/orgs","repos_url":"https://api.github.com/users/raghushantha/repos","events_url":"https://api.github.com/users/raghushantha/events{/privacy}","received_events_url":"https://api.github.com/users/raghushantha/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":14,"state":"open","created_at":"2015-04-28T05:57:20Z","updated_at":"2015-05-22T21:48:46Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2015-05-22T18:23:19Z","updated_at":"2015-05-23T02:33:50Z","closed_at":null,"body":"Right now for all of my modules I use ModuleToProcess in my manifest rather than the newer RootModule name.  Because of this, whenever I invoke Invoke-ScriptAnalyzer against my modules, I see the following warning:\r\n\r\nWARNING: The module manifest member 'ModuleToProcess' has been deprecated. Use the 'RootModule' member instead.\r\n\r\nThis warning is suggesting that I change my manifest to use RootModule instead.  While I understand why this warning is there, I think it's too early to suggest people switch to ModuleToProcess for one key reason: you can still invoke PowerShell 2.0 even on Windows 10 with WMF5 by running PowerShell -Version 2.\r\n\r\nWhy does that matter?  Because RootModule was only added in PowerShell 3.0, and if you try to import a module that has the RootModule key in the manifest in PowerShell 2.0 you get a completely different experience than if you try to import a module that requires a higher version of PowerShell but that has the ModuleToProcess key in its manifest.  In the former scenario, users get an error that seems to indicate the module itself has a problem, pointing at some unknown RootModule key in the manifest.  That is a really poor user experience.  In the latter scenario, users get an error that properly indicates that the PowerShell version for the current session does not meet the minimum requirements for the module.  That user experience is exactly what I want for users of my modules, and that is exactly the type of error I hope they get from any module that they try to open in PowerShell 2.0 that requires a later version (unless, of course, those modules require the use of other new manifest keys that don't have an equivalent in PowerShell 2.0).\r\n\r\nThe latter scenario is much better for the community, and since even with Windows 10/WMF5 users may open PowerShell 2.0, for modules that require PowerShell 3.0 or later I think it's a better practice to stick with ModuleToProcess as the key that identifies what module will be processed when the manifest is loaded.  Only when PowerShell 2.0 is really out of sight/out of mind should this warning start appearing so that manifests are updated to use the new key name.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/PowerShell/PSScriptAnalyzer/issues/comments/104820471","html_url":"https://github.com/PowerShell/PSScriptAnalyzer/issues/196#issuecomment-104820471","issue_url":"https://api.github.com/repos/PowerShell/PSScriptAnalyzer/issues/196","id":104820471,"user":{"login":"KirkMunro","id":3515485,"avatar_url":"https://avatars.githubusercontent.com/u/3515485?v=3","gravatar_id":"","url":"https://api.github.com/users/KirkMunro","html_url":"https://github.com/KirkMunro","followers_url":"https://api.github.com/users/KirkMunro/followers","following_url":"https://api.github.com/users/KirkMunro/following{/other_user}","gists_url":"https://api.github.com/users/KirkMunro/gists{/gist_id}","starred_url":"https://api.github.com/users/KirkMunro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KirkMunro/subscriptions","organizations_url":"https://api.github.com/users/KirkMunro/orgs","repos_url":"https://api.github.com/users/KirkMunro/repos","events_url":"https://api.github.com/users/KirkMunro/events{/privacy}","received_events_url":"https://api.github.com/users/KirkMunro/received_events","type":"User","site_admin":false},"created_at":"2015-05-23T02:33:50Z","updated_at":"2015-05-23T02:33:50Z","body":"@imfrancisd I'm using my forked version that supports PowerShell 3.0 or later.  I fetched the development branch from the source project yesterday, or the day before.  And since I'm using that fork (so that I can run it on my laptop which runs Windows 8.1/PowerShell 4 right now), I had to build it myself so that I could do that.\r\n\r\nIn my case, my modules target PowerShell 3.0 or later, where RootModule is available as a manifest key, but I still prefer using ModuleToProcess so that someone loading these modules on PS2.0 gets a more appropriate and useful error message.\r\n\r\n@yutingc Yes, that's something I think would be more valuable, indicating the minimum required version."}}