{"action":"created","comment":{"url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/pulls/comments/39798705","id":39798705,"diff_hunk":"@@ -64,6 +65,72 @@ dsc_windowsfeature {'IIS':\n \n All DSC Resource names and parameters have to be in lowercase, e.g: `dsc_windowsfeature` or `dsc_name`.\n \n+### Installing Packages with DSC\n+\n+You can install MSIs with DSC using the Puppet type `dsc_package` which maps to the `Package` DSC Resource.\n+\n+~~~puppet\n+dsc_package{'installpython'\n+  dsc_ensure    => 'Present',\n+  dsc_name      => 'Python 2.7.10',\n+  dsc_productid => 'E2B51919-207A-43EB-AE78-733F9C6797C2'\n+  dsc_path      => 'C:\\\\python.msi',\n+}\n+~~~\n+\n+The `Package` DSC Resource requires the following pieces of information to install an MSI:\n+\n+- ProductName: The `Name` of product being installed.\n+- ProductId: The `ProductCode` property of the MSI, which is a unique identifier for the particular product release, represented as a GUID string. For more information see [this link.](https://msdn.microsoft.com/en-us/library/aa370854(v=vs.85).aspx)\n+\n+You can obtain this information in a variety of ways.\n+\n+- Use a tool like Orca to open the MSI file and inspect the `Name` and `ProductCode`.\n+- Install the product on a test system and inspect the `Name` and `ProductCode` in the Windows Add/Remove Programs Control Panel\n+- Use a script to query the MSI file for the `Name` and `ProductCode`.\n+\n+~~~powershell\n+function Get-MsiDatabaseInfo\n+{\n+  param (\n+    [IO.FileInfo]$FilePath\n+  )\n+\n+  $productName = Invoke-MSIQuery -FilePath $filePath -Query \"SELECT Value FROM Property WHERE Property = 'ProductName'\"\n+  $productCode = Invoke-MSIQuery -FilePath $filePath -Query \"SELECT Value FROM Property WHERE Property = 'ProductCode'\"\n+\n+  return [PSCustomObject]@{\n+    FullName    = $FilePath.FullName\n+    ProductName = ([string]$productName).TrimStart()\n+    ProductCode = ([string]$productCode).Replace(\"{\",\"\").Replace(\"}\",\"\").TrimStart()\n+  }\n+}\n+\n+function Invoke-MSIQuery\n+{\n+  param($FilePath, $Query)\n+  try{\n+    $windowsInstaller = New-Object -com WindowsInstaller.Installer\n+    $database = $windowsInstaller.GetType().InvokeMember(\"OpenDatabase\", \"InvokeMethod\", $Null, $windowsInstaller, @($FilePath.FullName, 0))\n+  }catch{","path":"README.md","position":59,"original_position":59,"commit_id":"c1743b9ac097de82886dc2a41ca09c0148f32e70","original_commit_id":"c1743b9ac097de82886dc2a41ca09c0148f32e70","user":{"login":"ferventcoder","id":63502,"avatar_url":"https://avatars.githubusercontent.com/u/63502?v=3","gravatar_id":"","url":"https://api.github.com/users/ferventcoder","html_url":"https://github.com/ferventcoder","followers_url":"https://api.github.com/users/ferventcoder/followers","following_url":"https://api.github.com/users/ferventcoder/following{/other_user}","gists_url":"https://api.github.com/users/ferventcoder/gists{/gist_id}","starred_url":"https://api.github.com/users/ferventcoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ferventcoder/subscriptions","organizations_url":"https://api.github.com/users/ferventcoder/orgs","repos_url":"https://api.github.com/users/ferventcoder/repos","events_url":"https://api.github.com/users/ferventcoder/events{/privacy}","received_events_url":"https://api.github.com/users/ferventcoder/received_events","type":"User","site_admin":false},"body":"formatting","created_at":"2015-09-17T21:03:21Z","updated_at":"2015-09-17T21:03:21Z","html_url":"https://github.com/puppetlabs/puppetlabs-dsc/pull/96#discussion_r39798705","pull_request_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/pulls/96","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/pulls/comments/39798705"},"html":{"href":"https://github.com/puppetlabs/puppetlabs-dsc/pull/96#discussion_r39798705"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/pulls/96"}}},"pull_request":{"url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/pulls/96","id":44946727,"html_url":"https://github.com/puppetlabs/puppetlabs-dsc/pull/96","diff_url":"https://github.com/puppetlabs/puppetlabs-dsc/pull/96.diff","patch_url":"https://github.com/puppetlabs/puppetlabs-dsc/pull/96.patch","issue_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/issues/96","number":96,"state":"open","locked":false,"title":"(docs)(WIP)(MODULES-2466) Document ProductCode for Package DSC Resource","user":{"login":"jpogran","id":272569,"avatar_url":"https://avatars.githubusercontent.com/u/272569?v=3","gravatar_id":"","url":"https://api.github.com/users/jpogran","html_url":"https://github.com/jpogran","followers_url":"https://api.github.com/users/jpogran/followers","following_url":"https://api.github.com/users/jpogran/following{/other_user}","gists_url":"https://api.github.com/users/jpogran/gists{/gist_id}","starred_url":"https://api.github.com/users/jpogran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpogran/subscriptions","organizations_url":"https://api.github.com/users/jpogran/orgs","repos_url":"https://api.github.com/users/jpogran/repos","events_url":"https://api.github.com/users/jpogran/events{/privacy}","received_events_url":"https://api.github.com/users/jpogran/received_events","type":"User","site_admin":false},"body":"The Package DSC Resource uses the ProductName and ProductCode to identify\nif a MSI is installed, but does not tell the user where to find this\ninformaiton. It also refers to ProductCode as ProductId, further confusing\nthe issue.\n\nRequires PR #95 to be merged first to have correct Usage sub headings","created_at":"2015-09-14T15:50:04Z","updated_at":"2015-09-17T21:03:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"63bd7e5c60c28059ce3ed1c24ca194deeea4ce07","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/pulls/96/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/pulls/96/comments","review_comment_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/issues/96/comments","statuses_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/statuses/c1743b9ac097de82886dc2a41ca09c0148f32e70","head":{"label":"jpogran:ticket/master/MODULES-2466-msi-product-code-readme","ref":"ticket/master/MODULES-2466-msi-product-code-readme","sha":"c1743b9ac097de82886dc2a41ca09c0148f32e70","user":{"login":"jpogran","id":272569,"avatar_url":"https://avatars.githubusercontent.com/u/272569?v=3","gravatar_id":"","url":"https://api.github.com/users/jpogran","html_url":"https://github.com/jpogran","followers_url":"https://api.github.com/users/jpogran/followers","following_url":"https://api.github.com/users/jpogran/following{/other_user}","gists_url":"https://api.github.com/users/jpogran/gists{/gist_id}","starred_url":"https://api.github.com/users/jpogran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpogran/subscriptions","organizations_url":"https://api.github.com/users/jpogran/orgs","repos_url":"https://api.github.com/users/jpogran/repos","events_url":"https://api.github.com/users/jpogran/events{/privacy}","received_events_url":"https://api.github.com/users/jpogran/received_events","type":"User","site_admin":false},"repo":{"id":37696508,"name":"puppetlabs-dsc","full_name":"jpogran/puppetlabs-dsc","owner":{"login":"jpogran","id":272569,"avatar_url":"https://avatars.githubusercontent.com/u/272569?v=3","gravatar_id":"","url":"https://api.github.com/users/jpogran","html_url":"https://github.com/jpogran","followers_url":"https://api.github.com/users/jpogran/followers","following_url":"https://api.github.com/users/jpogran/following{/other_user}","gists_url":"https://api.github.com/users/jpogran/gists{/gist_id}","starred_url":"https://api.github.com/users/jpogran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpogran/subscriptions","organizations_url":"https://api.github.com/users/jpogran/orgs","repos_url":"https://api.github.com/users/jpogran/repos","events_url":"https://api.github.com/users/jpogran/events{/privacy}","received_events_url":"https://api.github.com/users/jpogran/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jpogran/puppetlabs-dsc","description":"Puppet module for PowerShell Desired State Configuration (DSC) integration","fork":true,"url":"https://api.github.com/repos/jpogran/puppetlabs-dsc","forks_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/forks","keys_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/teams","hooks_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/hooks","issue_events_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/issues/events{/number}","events_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/events","assignees_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/assignees{/user}","branches_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/branches{/branch}","tags_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/tags","blobs_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/git/refs{/sha}","trees_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/statuses/{sha}","languages_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/languages","stargazers_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/stargazers","contributors_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/contributors","subscribers_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/subscribers","subscription_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/subscription","commits_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/commits{/sha}","git_commits_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/git/commits{/sha}","comments_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/comments{/number}","issue_comment_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/issues/comments{/number}","contents_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/contents/{+path}","compare_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/merges","archive_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/downloads","issues_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/issues{/number}","pulls_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/pulls{/number}","milestones_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/milestones{/number}","notifications_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/labels{/name}","releases_url":"https://api.github.com/repos/jpogran/puppetlabs-dsc/releases{/id}","created_at":"2015-06-19T02:10:54Z","updated_at":"2015-08-11T14:38:57Z","pushed_at":"2015-09-16T20:37:12Z","git_url":"git://github.com/jpogran/puppetlabs-dsc.git","ssh_url":"git@github.com:jpogran/puppetlabs-dsc.git","clone_url":"https://github.com/jpogran/puppetlabs-dsc.git","svn_url":"https://github.com/jpogran/puppetlabs-dsc","homepage":"","size":9555,"stargazers_count":0,"watchers_count":0,"language":"PowerShell","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"puppetlabs:master","ref":"master","sha":"9b6ee2103fa52786d109279a44ea18e5ba24f578","user":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":21090303,"name":"puppetlabs-dsc","full_name":"puppetlabs/puppetlabs-dsc","owner":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/puppetlabs/puppetlabs-dsc","description":"Puppet module for PowerShell Desired State Configuration (DSC) integration","fork":false,"url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc","forks_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/forks","keys_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/teams","hooks_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/events","assignees_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/tags","blobs_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/subscription","commits_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/issues/comments{/number}","contents_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/merges","archive_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/downloads","issues_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/releases{/id}","created_at":"2014-06-22T09:42:33Z","updated_at":"2015-08-06T15:29:06Z","pushed_at":"2015-09-17T07:14:03Z","git_url":"git://github.com/puppetlabs/puppetlabs-dsc.git","ssh_url":"git@github.com:puppetlabs/puppetlabs-dsc.git","clone_url":"https://github.com/puppetlabs/puppetlabs-dsc.git","svn_url":"https://github.com/puppetlabs/puppetlabs-dsc","homepage":"","size":11472,"stargazers_count":17,"watchers_count":17,"language":"PowerShell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":8,"forks":11,"open_issues":8,"watchers":17,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/pulls/96"},"html":{"href":"https://github.com/puppetlabs/puppetlabs-dsc/pull/96"},"issue":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/issues/96"},"comments":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/issues/96/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/pulls/96/comments"},"review_comment":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/pulls/96/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-dsc/statuses/c1743b9ac097de82886dc2a41ca09c0148f32e70"}}}}