{"action":"created","issue":{"url":"https://api.github.com/repos/chef/chef/issues/4175","labels_url":"https://api.github.com/repos/chef/chef/issues/4175/labels{/name}","comments_url":"https://api.github.com/repos/chef/chef/issues/4175/comments","events_url":"https://api.github.com/repos/chef/chef/issues/4175/events","html_url":"https://github.com/chef/chef/issues/4175","id":117202813,"number":4175,"title":"Chef Client + Server 2008 R2 + PowerShell 5 + PowerShell DSC => Error on 2008 R2, Works fine on 2012 R2.","user":{"login":"DarwinJS","id":11597190,"avatar_url":"https://avatars.githubusercontent.com/u/11597190?v=3","gravatar_id":"","url":"https://api.github.com/users/DarwinJS","html_url":"https://github.com/DarwinJS","followers_url":"https://api.github.com/users/DarwinJS/followers","following_url":"https://api.github.com/users/DarwinJS/following{/other_user}","gists_url":"https://api.github.com/users/DarwinJS/gists{/gist_id}","starred_url":"https://api.github.com/users/DarwinJS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DarwinJS/subscriptions","organizations_url":"https://api.github.com/users/DarwinJS/orgs","repos_url":"https://api.github.com/users/DarwinJS/repos","events_url":"https://api.github.com/users/DarwinJS/events{/privacy}","received_events_url":"https://api.github.com/users/DarwinJS/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-16T19:46:25Z","updated_at":"2015-11-17T14:11:41Z","closed_at":null,"body":"A recipe receives the below error (at bottom) on Server 2008 R2 w/ PowerShell 5.0.10514.6 (dot net 4.5.2) works fine on Server 2012 R2 w/ PowerShell (dot net 4.5.2).\r\n\r\nThis error appears where I have previously seen Chef display an error that I must have PowerShell 5 to use PowerShell DSC under Chef.\r\n\r\nThe above two items lead me to believe that when Chef retrieves the PowerShell version number under *Server 2008 R2 + PowerShell 5.0.10514.6* ONLY - it also pulls in a bunch of spaces and the text \"PSVersion\".  (There are 13 spaces between \"5.0.10514.6\" and \"PSVersion\" - but the markdown interpretter on github collapses them.)\r\n\r\nDuring researching this on the internet, I have seen similar ruby error reports when junk get's into the version number Ruby is trying to compare.\r\n\r\n[2015-11-16T19:25:29+00:00] INFO: Processing powershell_script[Guard resource] action run (dynamically defined)\r\n[2015-11-16T19:25:29+00:00] INFO: Processing dsc_resource[addNetFrameworkFeature] action run (cookbookname::SQL-addFeatures line 13)\r\n[2015-11-16T19:25:29+00:00] INFO: Running queued delayed notifications before re-raising exception\r\n[2015-11-16T19:25:29+00:00] ERROR: Running exception handlers\r\n[2015-11-16T19:25:29+00:00] ERROR: Exception handlers complete\r\n[2015-11-16T19:25:29+00:00] INFO: Sending resource update report (run-id: a25d52f6-dbb6-4fda-8b01-cf37c12d4b07)\r\n[2015-11-16T19:25:30+00:00] FATAL: Stacktrace dumped to c:/chef/cache/chef-stacktrace.out\r\n**[2015-11-16T19:25:30+00:00] FATAL: ArgumentError: dsc_resource[addNetFrameworkFeature] (cookbookname::SQL-addFeatures line 13) had an error: ArgumentError: Malformed version number string 5.0.10514.6             PSVersion**\r\n[2015-11-16T19:25:40+00:00] INFO: Child process exited (pid: 1324)\r\n[2015-11-16T19:25:41+00:00] INFO: Next chef-client run will happen in 1800.6470914809777 seconds"},"comment":{"url":"https://api.github.com/repos/chef/chef/issues/comments/157380346","html_url":"https://github.com/chef/chef/issues/4175#issuecomment-157380346","issue_url":"https://api.github.com/repos/chef/chef/issues/4175","id":157380346,"user":{"login":"DarwinJS","id":11597190,"avatar_url":"https://avatars.githubusercontent.com/u/11597190?v=3","gravatar_id":"","url":"https://api.github.com/users/DarwinJS","html_url":"https://github.com/DarwinJS","followers_url":"https://api.github.com/users/DarwinJS/followers","following_url":"https://api.github.com/users/DarwinJS/following{/other_user}","gists_url":"https://api.github.com/users/DarwinJS/gists{/gist_id}","starred_url":"https://api.github.com/users/DarwinJS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DarwinJS/subscriptions","organizations_url":"https://api.github.com/users/DarwinJS/orgs","repos_url":"https://api.github.com/users/DarwinJS/repos","events_url":"https://api.github.com/users/DarwinJS/events{/privacy}","received_events_url":"https://api.github.com/users/DarwinJS/received_events","type":"User","site_admin":false},"created_at":"2015-11-17T14:11:41Z","updated_at":"2015-11-17T14:11:41Z","body":"I dug this down to https://raw.githubusercontent.com/chef/ohai/0e6456ca3e56ae4e84feabff87f3c538bf38964a/lib/ohai/plugins/powershell.rb which appears to use the output of $PSVersiontable to parse PowerShell's version number.\r\n\r\nHowever, the output of $psversiontable on both the 2008 R2 and 2012 R2 systems are identical.\r\n\r\nMaybe Ruby somehow parses this output differently on the two OS variations on line 40 ?\r\n\r\nD."}}