{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/azure-powershell/pulls/comments/80601945","pull_request_review_id":1649650,"id":80601945,"diff_hunk":"@@ -0,0 +1,133 @@\n+﻿[CmdletBinding()]\n+Param(\n+    [Parameter(Mandatory=$True, Position=0)]\n+    [String]$Service,\n+    [Parameter(Mandatory=$True, Position=1)]\n+    [String]$PathToRepo\n+)\n+\n+# Check to see if platyPS is already an installed module\n+if ((Get-Module -ListAvailable -Name platyPS).Count -eq 0)\n+{\n+    Write-Host \"Installing platyPS\"\n+    Install-Module -Name platyPS -scope CurrentUser\n+    Import-Module platyPS\n+}\n+\n+# If we can't find a path for the given service, then it doesn't exist in AzureRM\n+if (!(Test-Path $PathToRepo\\src\\ResourceManager\\$Service\\Commands.$Service))\n+{\n+    throw \"Cannot find path to $PathToRepo\\src\\ResourceManager\\$Service\\Commands.$Service\"\n+}\n+\n+# Import service module\n+Import-Module \"$PathToRepo\\src\\Package\\Debug\\ResourceManager\\AzureResourceManager\\AzureRM.$Service\\AzureRM.$Service.psd1\"\n+\n+$HelpPath = \"$PathToRepo\\src\\ResourceManager\\$Service\\Commands.$Service\\help\"\n+\n+# Check to see if there is already a folder containing markdown files for the given service\n+if (Test-Path $HelpPath)\n+{\n+    # Update the markdown files with the changes made in the cmdlets\n+    Update-MarkdownHelpModule $HelpPath -AlphabeticParamsOrder\n+}\n+else\n+{\n+    Write-Host \"Creating folder in $HelpPath to store markdown files\"\n+    New-Item $HelpPath -ItemType Directory > $null\n+\n+    # Generate markdown files\n+    New-MarkdownHelp -Module AzureRM.$Service -OutputFolder $HelpPath -WithModulePage -AlphabeticParamsOrder\n+\n+    # Edge case: existing MAML contains parameters WhatIf and Confirm for a cmdlet, but no description\n+    # Need to replace the @{Text=} description that will be generated with the auto-generated description from platyPS\n+\n+    $files = Get-ChildItem -Path $HelpPath\n+\n+    foreach ($file in $files)\n+    {\n+        # Ignore the module page\n+        if ($file.Name -eq \"AzureRM.$Service.md\")\n+        {\n+            continue\n+        }\n+\n+        $content = Get-Content $HelpPath\\$file\n+        $flag = $False\n+\n+        $newContent = New-Object string[] $content.Length\n+\n+        for ($idx = 0; $idx -lt $content.Length; $idx++)\n+        {\n+            if ($content[$idx] -like \"*### -Confirm*\" -and $content[$idx + 1] -like \"*@{Text=}\")\n+            {\n+                $flag = $True\n+                $newContent[$idx] = $content[$idx]\n+                $newContent[++$idx] = \"Prompts you for confirmation before running the cmdlet.\"\n+                    \n+            }\n+            elseif ($content[$idx] -like \"*### -WhatIf*\" -and $content[$idx + 1] -like \"*@{Text=}\")\n+            {\n+                $flag = $True\n+                $newContent[$idx] = $content[$idx]\n+                $newContent[++$idx] = \"Shows what would happen if the cmdlet runs. The cmdlet is not run.\"\n+            }\n+            else\n+            {\n+                $newContent[$idx] = $content[$idx]\n+            }\n+        }\n+\n+        # Replace the contents of the markdown file if we found an error with the descriptions\n+        if ($flag)\n+        {\n+            $result = $newContent -join \"`r`n\"\n+            $tempFile = Get-Item $HelpPath\\$file\n+\n+            [System.IO.File]::WriteAllText($tempFile.FullName, $result)\n+        }\n+    }\n+}\n+\n+# Generate the MAML help file from the markdown files","path":"tools/platyPS/GenerateHelp.ps1","position":92,"original_position":92,"commit_id":"82c8c215e5567f5a86fb0577d51c535a46806cad","original_commit_id":"82c8c215e5567f5a86fb0577d51c535a46806cad","user":{"login":"cormacpayne","id":4462409,"avatar_url":"https://avatars.githubusercontent.com/u/4462409?v=3","gravatar_id":"","url":"https://api.github.com/users/cormacpayne","html_url":"https://github.com/cormacpayne","followers_url":"https://api.github.com/users/cormacpayne/followers","following_url":"https://api.github.com/users/cormacpayne/following{/other_user}","gists_url":"https://api.github.com/users/cormacpayne/gists{/gist_id}","starred_url":"https://api.github.com/users/cormacpayne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cormacpayne/subscriptions","organizations_url":"https://api.github.com/users/cormacpayne/orgs","repos_url":"https://api.github.com/users/cormacpayne/repos","events_url":"https://api.github.com/users/cormacpayne/events{/privacy}","received_events_url":"https://api.github.com/users/cormacpayne/received_events","type":"User","site_admin":false},"body":"I liked the idea of one cmdlet to generate your markdown and MAML, no matter your status. Splitting into two cmdlets makes sense. I can change to that model when converting to a module.","created_at":"2016-09-27T00:27:06Z","updated_at":"2016-09-27T00:27:06Z","html_url":"https://github.com/Azure/azure-powershell/pull/2932#discussion_r80601945","pull_request_url":"https://api.github.com/repos/Azure/azure-powershell/pulls/2932","_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-powershell/pulls/comments/80601945"},"html":{"href":"https://github.com/Azure/azure-powershell/pull/2932#discussion_r80601945"},"pull_request":{"href":"https://api.github.com/repos/Azure/azure-powershell/pulls/2932"}}},"pull_request":{"url":"https://api.github.com/repos/Azure/azure-powershell/pulls/2932","id":85121708,"html_url":"https://github.com/Azure/azure-powershell/pull/2932","diff_url":"https://github.com/Azure/azure-powershell/pull/2932.diff","patch_url":"https://github.com/Azure/azure-powershell/pull/2932.patch","issue_url":"https://api.github.com/repos/Azure/azure-powershell/issues/2932","number":2932,"state":"open","locked":false,"title":"platyPS documentation and Profile conversion","user":{"login":"cormacpayne","id":4462409,"avatar_url":"https://avatars.githubusercontent.com/u/4462409?v=3","gravatar_id":"","url":"https://api.github.com/users/cormacpayne","html_url":"https://github.com/cormacpayne","followers_url":"https://api.github.com/users/cormacpayne/followers","following_url":"https://api.github.com/users/cormacpayne/following{/other_user}","gists_url":"https://api.github.com/users/cormacpayne/gists{/gist_id}","starred_url":"https://api.github.com/users/cormacpayne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cormacpayne/subscriptions","organizations_url":"https://api.github.com/users/cormacpayne/orgs","repos_url":"https://api.github.com/users/cormacpayne/repos","events_url":"https://api.github.com/users/cormacpayne/events{/privacy}","received_events_url":"https://api.github.com/users/cormacpayne/received_events","type":"User","site_admin":false},"body":"## Comments\r\n\r\nFix for issue https://github.com/Azure/azure-powershell/issues/2921\r\n\r\nplatyPS is a tool used to convert the current MAML help files into individual markdown files for each cmdlet in a service. This allows partners to easily edit the help for cmdlets using markdown rather than MAML.\r\n\r\nThis commit contains documentation on how to use the platyPS tool to make these changes, as well as scripts that will help a service team generate these markdown files and validate that they have all of the necessary help information for each cmdlet.\r\n\r\nThis commit also converts Profile to the markdown help, which will need to be updated in a separate PR.\r\n\r\n---\r\n\r\nThis checklist is used to make sure that common issues in a pull request are covered by the creator. You can find a more complete discussion of PowerShell cmdlet best practices [here](https://msdn.microsoft.com/en-us/library/dd878270(v=vs.85).aspx).\r\n\r\nBelow in **Overall Changes**, check off the boxes that apply to your PR. For the categories that you did not check off, you can remove them from this body. Within each of the categories that you did select, make sure that you can check off **all** of the boxes. \r\n\r\nFor information on cleaning up the commits in your pull request, click [here](../documentation/cleaning-up-commits.md).\r\n\r\n## Overall Changes \r\n- [x] [**MANDATORY** - General changes](#general)\r\n- [x] [**MANDATORY** - Add/remove/edit test(s)](#tests)\r\n\r\n### General\r\n- [x] Title of the PR is clear and informative\r\n- [x] There are a small number of commits that each have an informative message\r\n- [x] If it applies, references the bug/issue that the PR fixes\r\n- [x] All files have the Microsoft copyright header\r\n- [x] Cmdlets refer to management libraries through nuget references - no dlls are checked in\r\n- [x] The PR does not introduce breaking changes (unless a major version change occurs in the assembly and module)\r\n\r\n### Tests\r\n- [x] PR includes test coverage for the included changes\r\n- [x] Tests must use xunit, and should either use Moq to mock management client calls, or use the scenario test framework\r\n- [x] PowerShell scripts used in tests must not use hard-coded values for location\r\n- [x] PowerShell scripts used in tests should do any necessary setup as part of the test or suite setup, and should not use hard-coded values for existing resources\r\n- [x] Tests should not use App.config files for settings\r\n- [x] Tests should use the built-in PowerShell functions for generating random names when unique names are necessary - this will store names in the test recording\r\n- [x] Tests should use Start-Sleep to pause rather than Thread.Sleep\r\n","created_at":"2016-09-13T20:44:11Z","updated_at":"2016-09-27T00:27:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bec3f55a3619888a1d2e3077e857fab64e29c804","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Azure/azure-powershell/pulls/2932/commits","review_comments_url":"https://api.github.com/repos/Azure/azure-powershell/pulls/2932/comments","review_comment_url":"https://api.github.com/repos/Azure/azure-powershell/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/azure-powershell/issues/2932/comments","statuses_url":"https://api.github.com/repos/Azure/azure-powershell/statuses/82c8c215e5567f5a86fb0577d51c535a46806cad","head":{"label":"cormacpayne:platyps-help","ref":"platyps-help","sha":"82c8c215e5567f5a86fb0577d51c535a46806cad","user":{"login":"cormacpayne","id":4462409,"avatar_url":"https://avatars.githubusercontent.com/u/4462409?v=3","gravatar_id":"","url":"https://api.github.com/users/cormacpayne","html_url":"https://github.com/cormacpayne","followers_url":"https://api.github.com/users/cormacpayne/followers","following_url":"https://api.github.com/users/cormacpayne/following{/other_user}","gists_url":"https://api.github.com/users/cormacpayne/gists{/gist_id}","starred_url":"https://api.github.com/users/cormacpayne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cormacpayne/subscriptions","organizations_url":"https://api.github.com/users/cormacpayne/orgs","repos_url":"https://api.github.com/users/cormacpayne/repos","events_url":"https://api.github.com/users/cormacpayne/events{/privacy}","received_events_url":"https://api.github.com/users/cormacpayne/received_events","type":"User","site_admin":false},"repo":{"id":64254912,"name":"azure-powershell","full_name":"cormacpayne/azure-powershell","owner":{"login":"cormacpayne","id":4462409,"avatar_url":"https://avatars.githubusercontent.com/u/4462409?v=3","gravatar_id":"","url":"https://api.github.com/users/cormacpayne","html_url":"https://github.com/cormacpayne","followers_url":"https://api.github.com/users/cormacpayne/followers","following_url":"https://api.github.com/users/cormacpayne/following{/other_user}","gists_url":"https://api.github.com/users/cormacpayne/gists{/gist_id}","starred_url":"https://api.github.com/users/cormacpayne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cormacpayne/subscriptions","organizations_url":"https://api.github.com/users/cormacpayne/orgs","repos_url":"https://api.github.com/users/cormacpayne/repos","events_url":"https://api.github.com/users/cormacpayne/events{/privacy}","received_events_url":"https://api.github.com/users/cormacpayne/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cormacpayne/azure-powershell","description":"Microsoft Azure PowerShell","fork":true,"url":"https://api.github.com/repos/cormacpayne/azure-powershell","forks_url":"https://api.github.com/repos/cormacpayne/azure-powershell/forks","keys_url":"https://api.github.com/repos/cormacpayne/azure-powershell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cormacpayne/azure-powershell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cormacpayne/azure-powershell/teams","hooks_url":"https://api.github.com/repos/cormacpayne/azure-powershell/hooks","issue_events_url":"https://api.github.com/repos/cormacpayne/azure-powershell/issues/events{/number}","events_url":"https://api.github.com/repos/cormacpayne/azure-powershell/events","assignees_url":"https://api.github.com/repos/cormacpayne/azure-powershell/assignees{/user}","branches_url":"https://api.github.com/repos/cormacpayne/azure-powershell/branches{/branch}","tags_url":"https://api.github.com/repos/cormacpayne/azure-powershell/tags","blobs_url":"https://api.github.com/repos/cormacpayne/azure-powershell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cormacpayne/azure-powershell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cormacpayne/azure-powershell/git/refs{/sha}","trees_url":"https://api.github.com/repos/cormacpayne/azure-powershell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cormacpayne/azure-powershell/statuses/{sha}","languages_url":"https://api.github.com/repos/cormacpayne/azure-powershell/languages","stargazers_url":"https://api.github.com/repos/cormacpayne/azure-powershell/stargazers","contributors_url":"https://api.github.com/repos/cormacpayne/azure-powershell/contributors","subscribers_url":"https://api.github.com/repos/cormacpayne/azure-powershell/subscribers","subscription_url":"https://api.github.com/repos/cormacpayne/azure-powershell/subscription","commits_url":"https://api.github.com/repos/cormacpayne/azure-powershell/commits{/sha}","git_commits_url":"https://api.github.com/repos/cormacpayne/azure-powershell/git/commits{/sha}","comments_url":"https://api.github.com/repos/cormacpayne/azure-powershell/comments{/number}","issue_comment_url":"https://api.github.com/repos/cormacpayne/azure-powershell/issues/comments{/number}","contents_url":"https://api.github.com/repos/cormacpayne/azure-powershell/contents/{+path}","compare_url":"https://api.github.com/repos/cormacpayne/azure-powershell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cormacpayne/azure-powershell/merges","archive_url":"https://api.github.com/repos/cormacpayne/azure-powershell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cormacpayne/azure-powershell/downloads","issues_url":"https://api.github.com/repos/cormacpayne/azure-powershell/issues{/number}","pulls_url":"https://api.github.com/repos/cormacpayne/azure-powershell/pulls{/number}","milestones_url":"https://api.github.com/repos/cormacpayne/azure-powershell/milestones{/number}","notifications_url":"https://api.github.com/repos/cormacpayne/azure-powershell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cormacpayne/azure-powershell/labels{/name}","releases_url":"https://api.github.com/repos/cormacpayne/azure-powershell/releases{/id}","deployments_url":"https://api.github.com/repos/cormacpayne/azure-powershell/deployments","created_at":"2016-07-26T21:09:37Z","updated_at":"2016-07-26T21:10:06Z","pushed_at":"2016-09-26T22:45:02Z","git_url":"git://github.com/cormacpayne/azure-powershell.git","ssh_url":"git@github.com:cormacpayne/azure-powershell.git","clone_url":"https://github.com/cormacpayne/azure-powershell.git","svn_url":"https://github.com/cormacpayne/azure-powershell","homepage":null,"size":217471,"stargazers_count":0,"watchers_count":0,"language":"C#","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":"dev"}},"base":{"label":"Azure:dev","ref":"dev","sha":"84650147f174726ae31a7a3e0d5c5005e9161043","user":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":23891194,"name":"azure-powershell","full_name":"Azure/azure-powershell","owner":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/azure-powershell","description":"Microsoft Azure PowerShell","fork":false,"url":"https://api.github.com/repos/Azure/azure-powershell","forks_url":"https://api.github.com/repos/Azure/azure-powershell/forks","keys_url":"https://api.github.com/repos/Azure/azure-powershell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/azure-powershell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/azure-powershell/teams","hooks_url":"https://api.github.com/repos/Azure/azure-powershell/hooks","issue_events_url":"https://api.github.com/repos/Azure/azure-powershell/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/azure-powershell/events","assignees_url":"https://api.github.com/repos/Azure/azure-powershell/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/azure-powershell/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/azure-powershell/tags","blobs_url":"https://api.github.com/repos/Azure/azure-powershell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/azure-powershell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/azure-powershell/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/azure-powershell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/azure-powershell/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/azure-powershell/languages","stargazers_url":"https://api.github.com/repos/Azure/azure-powershell/stargazers","contributors_url":"https://api.github.com/repos/Azure/azure-powershell/contributors","subscribers_url":"https://api.github.com/repos/Azure/azure-powershell/subscribers","subscription_url":"https://api.github.com/repos/Azure/azure-powershell/subscription","commits_url":"https://api.github.com/repos/Azure/azure-powershell/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/azure-powershell/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/azure-powershell/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/azure-powershell/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/azure-powershell/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/azure-powershell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/azure-powershell/merges","archive_url":"https://api.github.com/repos/Azure/azure-powershell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/azure-powershell/downloads","issues_url":"https://api.github.com/repos/Azure/azure-powershell/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/azure-powershell/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/azure-powershell/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/azure-powershell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/azure-powershell/labels{/name}","releases_url":"https://api.github.com/repos/Azure/azure-powershell/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/azure-powershell/deployments","created_at":"2014-09-10T20:35:18Z","updated_at":"2016-09-26T18:09:37Z","pushed_at":"2016-09-26T23:05:56Z","git_url":"git://github.com/Azure/azure-powershell.git","ssh_url":"git@github.com:Azure/azure-powershell.git","clone_url":"https://github.com/Azure/azure-powershell.git","svn_url":"https://github.com/Azure/azure-powershell","homepage":null,"size":323579,"stargazers_count":550,"watchers_count":550,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":525,"mirror_url":null,"open_issues_count":449,"forks":525,"open_issues":449,"watchers":550,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-powershell/pulls/2932"},"html":{"href":"https://github.com/Azure/azure-powershell/pull/2932"},"issue":{"href":"https://api.github.com/repos/Azure/azure-powershell/issues/2932"},"comments":{"href":"https://api.github.com/repos/Azure/azure-powershell/issues/2932/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/azure-powershell/pulls/2932/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/azure-powershell/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/azure-powershell/pulls/2932/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/azure-powershell/statuses/82c8c215e5567f5a86fb0577d51c535a46806cad"}}}}
{"actor":{"display_login":"cormacpayne"}}