{"action":"closed","number":18,"pull_request":{"url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/pulls/18","id":42607097,"html_url":"https://github.com/BenjaminArmstrong/Hyper-V-PowerShell/pull/18","diff_url":"https://github.com/BenjaminArmstrong/Hyper-V-PowerShell/pull/18.diff","patch_url":"https://github.com/BenjaminArmstrong/Hyper-V-PowerShell/pull/18.patch","issue_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/issues/18","number":18,"state":"closed","locked":false,"title":"Optimize final VHD","user":{"login":"grantemsley","id":669579,"avatar_url":"https://avatars.githubusercontent.com/u/669579?v=3","gravatar_id":"","url":"https://api.github.com/users/grantemsley","html_url":"https://github.com/grantemsley","followers_url":"https://api.github.com/users/grantemsley/followers","following_url":"https://api.github.com/users/grantemsley/following{/other_user}","gists_url":"https://api.github.com/users/grantemsley/gists{/gist_id}","starred_url":"https://api.github.com/users/grantemsley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grantemsley/subscriptions","organizations_url":"https://api.github.com/users/grantemsley/orgs","repos_url":"https://api.github.com/users/grantemsley/repos","events_url":"https://api.github.com/users/grantemsley/events{/privacy}","received_events_url":"https://api.github.com/users/grantemsley/received_events","type":"User","site_admin":false},"body":"This adds two methods of optimizing the final VHD to be smaller.\r\n\r\nThe first mounts the VHDX file read only, and runs \"Optimize-VHD -Mode Full\" on it twice. Mounting it read only allows it to do some more optimizing.  Why run it twice?  No idea, but at least on my Windows 8.1 test system, the first run does nothing, but the second one shrinks the images by about 100-200MB.\r\n\r\nThe second method is disabled by default and has to be turned on in FactoryVariables, because it takes an extra 20-30 minutes per image.  It uses dism to clean out the WinSXS directory of any superseded components.  This saves a further 100MB on my 2012R2 datacenter GUI image. I expect the amount saved will get even larger as time goes on and more updates get applied.\r\n\r\nA few hundred MB in a 12-13GB image may not be much, but if you're deploying these files a lot it adds up quickly.","created_at":"2015-08-17T16:28:10Z","updated_at":"2015-08-17T18:27:28Z","closed_at":"2015-08-17T18:27:28Z","merged_at":"2015-08-17T18:27:28Z","merge_commit_sha":"2286bc35f79922c41efb5fb681c9d67465c0ff25","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/pulls/18/commits","review_comments_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/pulls/18/comments","review_comment_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/pulls/comments{/number}","comments_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/issues/18/comments","statuses_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/statuses/5f5fac87713b82303c080252f48d99c845e78db7","head":{"label":"grantemsley:optimizevhd","ref":"optimizevhd","sha":"5f5fac87713b82303c080252f48d99c845e78db7","user":{"login":"grantemsley","id":669579,"avatar_url":"https://avatars.githubusercontent.com/u/669579?v=3","gravatar_id":"","url":"https://api.github.com/users/grantemsley","html_url":"https://github.com/grantemsley","followers_url":"https://api.github.com/users/grantemsley/followers","following_url":"https://api.github.com/users/grantemsley/following{/other_user}","gists_url":"https://api.github.com/users/grantemsley/gists{/gist_id}","starred_url":"https://api.github.com/users/grantemsley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grantemsley/subscriptions","organizations_url":"https://api.github.com/users/grantemsley/orgs","repos_url":"https://api.github.com/users/grantemsley/repos","events_url":"https://api.github.com/users/grantemsley/events{/privacy}","received_events_url":"https://api.github.com/users/grantemsley/received_events","type":"User","site_admin":false},"repo":{"id":40784345,"name":"Hyper-V-PowerShell","full_name":"grantemsley/Hyper-V-PowerShell","owner":{"login":"grantemsley","id":669579,"avatar_url":"https://avatars.githubusercontent.com/u/669579?v=3","gravatar_id":"","url":"https://api.github.com/users/grantemsley","html_url":"https://github.com/grantemsley","followers_url":"https://api.github.com/users/grantemsley/followers","following_url":"https://api.github.com/users/grantemsley/following{/other_user}","gists_url":"https://api.github.com/users/grantemsley/gists{/gist_id}","starred_url":"https://api.github.com/users/grantemsley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grantemsley/subscriptions","organizations_url":"https://api.github.com/users/grantemsley/orgs","repos_url":"https://api.github.com/users/grantemsley/repos","events_url":"https://api.github.com/users/grantemsley/events{/privacy}","received_events_url":"https://api.github.com/users/grantemsley/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/grantemsley/Hyper-V-PowerShell","description":"Scripts that primarily use the Hyper-V PowerShell interfaces driving virtual machines","fork":true,"url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell","forks_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/forks","keys_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/teams","hooks_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/hooks","issue_events_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/issues/events{/number}","events_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/events","assignees_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/assignees{/user}","branches_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/branches{/branch}","tags_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/tags","blobs_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/git/refs{/sha}","trees_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/statuses/{sha}","languages_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/languages","stargazers_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/stargazers","contributors_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/contributors","subscribers_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/subscribers","subscription_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/subscription","commits_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/commits{/sha}","git_commits_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/git/commits{/sha}","comments_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/comments{/number}","issue_comment_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/issues/comments{/number}","contents_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/contents/{+path}","compare_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/merges","archive_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/downloads","issues_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/issues{/number}","pulls_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/pulls{/number}","milestones_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/milestones{/number}","notifications_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/labels{/name}","releases_url":"https://api.github.com/repos/grantemsley/Hyper-V-PowerShell/releases{/id}","created_at":"2015-08-15T20:50:49Z","updated_at":"2015-08-15T20:50:49Z","pushed_at":"2015-08-17T16:21:05Z","git_url":"git://github.com/grantemsley/Hyper-V-PowerShell.git","ssh_url":"git@github.com:grantemsley/Hyper-V-PowerShell.git","clone_url":"https://github.com/grantemsley/Hyper-V-PowerShell.git","svn_url":"https://github.com/grantemsley/Hyper-V-PowerShell","homepage":null,"size":142,"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":"BenjaminArmstrong:master","ref":"master","sha":"df13b8caabf4eec460b71edaffa6d07c6e9195f4","user":{"login":"BenjaminArmstrong","id":12947071,"avatar_url":"https://avatars.githubusercontent.com/u/12947071?v=3","gravatar_id":"","url":"https://api.github.com/users/BenjaminArmstrong","html_url":"https://github.com/BenjaminArmstrong","followers_url":"https://api.github.com/users/BenjaminArmstrong/followers","following_url":"https://api.github.com/users/BenjaminArmstrong/following{/other_user}","gists_url":"https://api.github.com/users/BenjaminArmstrong/gists{/gist_id}","starred_url":"https://api.github.com/users/BenjaminArmstrong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BenjaminArmstrong/subscriptions","organizations_url":"https://api.github.com/users/BenjaminArmstrong/orgs","repos_url":"https://api.github.com/users/BenjaminArmstrong/repos","events_url":"https://api.github.com/users/BenjaminArmstrong/events{/privacy}","received_events_url":"https://api.github.com/users/BenjaminArmstrong/received_events","type":"User","site_admin":false},"repo":{"id":39370931,"name":"Hyper-V-PowerShell","full_name":"BenjaminArmstrong/Hyper-V-PowerShell","owner":{"login":"BenjaminArmstrong","id":12947071,"avatar_url":"https://avatars.githubusercontent.com/u/12947071?v=3","gravatar_id":"","url":"https://api.github.com/users/BenjaminArmstrong","html_url":"https://github.com/BenjaminArmstrong","followers_url":"https://api.github.com/users/BenjaminArmstrong/followers","following_url":"https://api.github.com/users/BenjaminArmstrong/following{/other_user}","gists_url":"https://api.github.com/users/BenjaminArmstrong/gists{/gist_id}","starred_url":"https://api.github.com/users/BenjaminArmstrong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BenjaminArmstrong/subscriptions","organizations_url":"https://api.github.com/users/BenjaminArmstrong/orgs","repos_url":"https://api.github.com/users/BenjaminArmstrong/repos","events_url":"https://api.github.com/users/BenjaminArmstrong/events{/privacy}","received_events_url":"https://api.github.com/users/BenjaminArmstrong/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/BenjaminArmstrong/Hyper-V-PowerShell","description":"Scripts that primarily use the Hyper-V PowerShell interfaces driving virtual machines","fork":false,"url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell","forks_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/forks","keys_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/teams","hooks_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/hooks","issue_events_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/issues/events{/number}","events_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/events","assignees_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/assignees{/user}","branches_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/branches{/branch}","tags_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/tags","blobs_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/git/refs{/sha}","trees_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/statuses/{sha}","languages_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/languages","stargazers_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/stargazers","contributors_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/contributors","subscribers_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/subscribers","subscription_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/subscription","commits_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/commits{/sha}","git_commits_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/git/commits{/sha}","comments_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/comments{/number}","issue_comment_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/issues/comments{/number}","contents_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/contents/{+path}","compare_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/merges","archive_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/downloads","issues_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/issues{/number}","pulls_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/pulls{/number}","milestones_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/milestones{/number}","notifications_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/labels{/name}","releases_url":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/releases{/id}","created_at":"2015-07-20T08:04:24Z","updated_at":"2015-08-16T19:00:41Z","pushed_at":"2015-08-17T18:27:28Z","git_url":"git://github.com/BenjaminArmstrong/Hyper-V-PowerShell.git","ssh_url":"git@github.com:BenjaminArmstrong/Hyper-V-PowerShell.git","clone_url":"https://github.com/BenjaminArmstrong/Hyper-V-PowerShell.git","svn_url":"https://github.com/BenjaminArmstrong/Hyper-V-PowerShell","homepage":null,"size":309,"stargazers_count":15,"watchers_count":15,"language":"PowerShell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/pulls/18"},"html":{"href":"https://github.com/BenjaminArmstrong/Hyper-V-PowerShell/pull/18"},"issue":{"href":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/issues/18"},"comments":{"href":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/BenjaminArmstrong/Hyper-V-PowerShell/statuses/5f5fac87713b82303c080252f48d99c845e78db7"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"BenjaminArmstrong","id":12947071,"avatar_url":"https://avatars.githubusercontent.com/u/12947071?v=3","gravatar_id":"","url":"https://api.github.com/users/BenjaminArmstrong","html_url":"https://github.com/BenjaminArmstrong","followers_url":"https://api.github.com/users/BenjaminArmstrong/followers","following_url":"https://api.github.com/users/BenjaminArmstrong/following{/other_user}","gists_url":"https://api.github.com/users/BenjaminArmstrong/gists{/gist_id}","starred_url":"https://api.github.com/users/BenjaminArmstrong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BenjaminArmstrong/subscriptions","organizations_url":"https://api.github.com/users/BenjaminArmstrong/orgs","repos_url":"https://api.github.com/users/BenjaminArmstrong/repos","events_url":"https://api.github.com/users/BenjaminArmstrong/events{/privacy}","received_events_url":"https://api.github.com/users/BenjaminArmstrong/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":2,"additions":35,"deletions":3,"changed_files":3}}