{"action":"created","comment":{"url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/pulls/comments/166864750","pull_request_review_id":94993466,"id":166864750,"diff_hunk":"@@ -0,0 +1,61 @@\n+function Get-AttachmentFile {\n+    [CmdletBinding()]\n+    [OutputType([Bool])]\n+    param (\n+        [Parameter( Mandatory = $true )]\n+        [URi]$apiURi,\n+\n+        [Parameter( Mandatory = $true )]\n+        [PSCredential]$Credential,\n+\n+        [Parameter(\n+            Mandatory = $true,\n+            ValueFromPipeline = $true\n+        )]\n+        [ConfluencePS.Attachment]$Attachment,\n+\n+        [String]$OutFile","path":"ConfluencePS/Public/Get-AttachmentFile.ps1","position":17,"original_position":17,"commit_id":"b38584cca7ca2296ea7a8f84adec57ef23858dca","original_commit_id":"d5e4ebd334d043bd1c5c50d2a2c62f5069a9f2a9","user":{"login":"JohnAdders","id":16005222,"avatar_url":"https://avatars2.githubusercontent.com/u/16005222?v=4","gravatar_id":"","url":"https://api.github.com/users/JohnAdders","html_url":"https://github.com/JohnAdders","followers_url":"https://api.github.com/users/JohnAdders/followers","following_url":"https://api.github.com/users/JohnAdders/following{/other_user}","gists_url":"https://api.github.com/users/JohnAdders/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnAdders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnAdders/subscriptions","organizations_url":"https://api.github.com/users/JohnAdders/orgs","repos_url":"https://api.github.com/users/JohnAdders/repos","events_url":"https://api.github.com/users/JohnAdders/events{/privacy}","received_events_url":"https://api.github.com/users/JohnAdders/received_events","type":"User","site_admin":false},"body":"There are a number of issues that I'm trying to deal with:\r\n\r\n - filename is only unique within a single page so if downloading a site into a single directory steps need to be taken to avoid clobber\r\n - filenames can contain invalid characters for windows files, importing word docs for example sometimes seems to generate files with : in them\r\n\r\nSo the default is it will download the files using the filename to the current path which I think is the expected behaviour.  If you are downloading a single attachment you can set the complete filename yourself as required. If you are downloading multiple files you have the option of passing a string containing  a format string with access to various parts to use in completing a final path so passing \"c:\\somepath\\{1}\" would create filenames using the attachment id.","created_at":"2018-02-08T08:52:55Z","updated_at":"2018-02-08T08:52:55Z","html_url":"https://github.com/AtlassianPS/ConfluencePS/pull/123#discussion_r166864750","pull_request_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/pulls/123","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/AtlassianPS/ConfluencePS/pulls/comments/166864750"},"html":{"href":"https://github.com/AtlassianPS/ConfluencePS/pull/123#discussion_r166864750"},"pull_request":{"href":"https://api.github.com/repos/AtlassianPS/ConfluencePS/pulls/123"}},"in_reply_to_id":166746800},"pull_request":{"url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/pulls/123","id":166019824,"html_url":"https://github.com/AtlassianPS/ConfluencePS/pull/123","diff_url":"https://github.com/AtlassianPS/ConfluencePS/pull/123.diff","patch_url":"https://github.com/AtlassianPS/ConfluencePS/pull/123.patch","issue_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/issues/123","number":123,"state":"open","locked":false,"title":"Add basic support for attachments.","user":{"login":"JohnAdders","id":16005222,"avatar_url":"https://avatars2.githubusercontent.com/u/16005222?v=4","gravatar_id":"","url":"https://api.github.com/users/JohnAdders","html_url":"https://github.com/JohnAdders","followers_url":"https://api.github.com/users/JohnAdders/followers","following_url":"https://api.github.com/users/JohnAdders/following{/other_user}","gists_url":"https://api.github.com/users/JohnAdders/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnAdders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnAdders/subscriptions","organizations_url":"https://api.github.com/users/JohnAdders/orgs","repos_url":"https://api.github.com/users/JohnAdders/repos","events_url":"https://api.github.com/users/JohnAdders/events{/privacy}","received_events_url":"https://api.github.com/users/JohnAdders/received_events","type":"User","site_admin":false},"body":"### Description\r\nAdds support for reading list of attachments from a page\r\nand downloading attachments.\r\n\r\n### Motivation and Context\r\nFixes part of issue #47 \r\n\r\n### Types of changes\r\n- [ ] Bug fix (non-breaking change which fixes an issue)\r\n- [x] New feature (non-breaking change which adds functionality)\r\n- [ ] Breaking change (fix or feature that would cause existing functionality to change)\r\n\r\n### Checklist:\r\n- [x] My code follows the code style of this project.\r\n- [ ] I have added Pester Tests that describe what my changes should do.\r\n- [x] I have updated the documentation accordingly.\r\n","created_at":"2018-01-30T15:52:28Z","updated_at":"2018-02-08T08:52:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e1c0b92aa9f16752656d2e202dd0c941baf61b51","assignee":{"login":"JohnAdders","id":16005222,"avatar_url":"https://avatars2.githubusercontent.com/u/16005222?v=4","gravatar_id":"","url":"https://api.github.com/users/JohnAdders","html_url":"https://github.com/JohnAdders","followers_url":"https://api.github.com/users/JohnAdders/followers","following_url":"https://api.github.com/users/JohnAdders/following{/other_user}","gists_url":"https://api.github.com/users/JohnAdders/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnAdders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnAdders/subscriptions","organizations_url":"https://api.github.com/users/JohnAdders/orgs","repos_url":"https://api.github.com/users/JohnAdders/repos","events_url":"https://api.github.com/users/JohnAdders/events{/privacy}","received_events_url":"https://api.github.com/users/JohnAdders/received_events","type":"User","site_admin":false},"assignees":[{"login":"JohnAdders","id":16005222,"avatar_url":"https://avatars2.githubusercontent.com/u/16005222?v=4","gravatar_id":"","url":"https://api.github.com/users/JohnAdders","html_url":"https://github.com/JohnAdders","followers_url":"https://api.github.com/users/JohnAdders/followers","following_url":"https://api.github.com/users/JohnAdders/following{/other_user}","gists_url":"https://api.github.com/users/JohnAdders/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnAdders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnAdders/subscriptions","organizations_url":"https://api.github.com/users/JohnAdders/orgs","repos_url":"https://api.github.com/users/JohnAdders/repos","events_url":"https://api.github.com/users/JohnAdders/events{/privacy}","received_events_url":"https://api.github.com/users/JohnAdders/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/pulls/123/commits","review_comments_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/pulls/123/comments","review_comment_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/issues/123/comments","statuses_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/statuses/b38584cca7ca2296ea7a8f84adec57ef23858dca","head":{"label":"JohnAdders:develop","ref":"develop","sha":"b38584cca7ca2296ea7a8f84adec57ef23858dca","user":{"login":"JohnAdders","id":16005222,"avatar_url":"https://avatars2.githubusercontent.com/u/16005222?v=4","gravatar_id":"","url":"https://api.github.com/users/JohnAdders","html_url":"https://github.com/JohnAdders","followers_url":"https://api.github.com/users/JohnAdders/followers","following_url":"https://api.github.com/users/JohnAdders/following{/other_user}","gists_url":"https://api.github.com/users/JohnAdders/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnAdders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnAdders/subscriptions","organizations_url":"https://api.github.com/users/JohnAdders/orgs","repos_url":"https://api.github.com/users/JohnAdders/repos","events_url":"https://api.github.com/users/JohnAdders/events{/privacy}","received_events_url":"https://api.github.com/users/JohnAdders/received_events","type":"User","site_admin":false},"repo":{"id":108100954,"name":"ConfluencePS","full_name":"JohnAdders/ConfluencePS","owner":{"login":"JohnAdders","id":16005222,"avatar_url":"https://avatars2.githubusercontent.com/u/16005222?v=4","gravatar_id":"","url":"https://api.github.com/users/JohnAdders","html_url":"https://github.com/JohnAdders","followers_url":"https://api.github.com/users/JohnAdders/followers","following_url":"https://api.github.com/users/JohnAdders/following{/other_user}","gists_url":"https://api.github.com/users/JohnAdders/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnAdders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnAdders/subscriptions","organizations_url":"https://api.github.com/users/JohnAdders/orgs","repos_url":"https://api.github.com/users/JohnAdders/repos","events_url":"https://api.github.com/users/JohnAdders/events{/privacy}","received_events_url":"https://api.github.com/users/JohnAdders/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JohnAdders/ConfluencePS","description":"Confluence REST API (including Cloud) via PowerShell","fork":true,"url":"https://api.github.com/repos/JohnAdders/ConfluencePS","forks_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/forks","keys_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/teams","hooks_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/hooks","issue_events_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/issues/events{/number}","events_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/events","assignees_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/assignees{/user}","branches_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/branches{/branch}","tags_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/tags","blobs_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/git/refs{/sha}","trees_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/statuses/{sha}","languages_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/languages","stargazers_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/stargazers","contributors_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/contributors","subscribers_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/subscribers","subscription_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/subscription","commits_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/commits{/sha}","git_commits_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/git/commits{/sha}","comments_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/comments{/number}","issue_comment_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/issues/comments{/number}","contents_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/contents/{+path}","compare_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/merges","archive_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/downloads","issues_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/issues{/number}","pulls_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/pulls{/number}","milestones_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/milestones{/number}","notifications_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/labels{/name}","releases_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/releases{/id}","deployments_url":"https://api.github.com/repos/JohnAdders/ConfluencePS/deployments","created_at":"2017-10-24T08:49:25Z","updated_at":"2017-10-24T08:49:27Z","pushed_at":"2018-02-07T22:08:59Z","git_url":"git://github.com/JohnAdders/ConfluencePS.git","ssh_url":"git@github.com:JohnAdders/ConfluencePS.git","clone_url":"https://github.com/JohnAdders/ConfluencePS.git","svn_url":"https://github.com/JohnAdders/ConfluencePS","homepage":"https://AtlassianPS.org/module/ConfluencePS","size":401,"stargazers_count":0,"watchers_count":0,"language":"PowerShell","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"AtlassianPS:develop","ref":"develop","sha":"0a6cf4d6d0c4a8633a3834ee4a9178eef832dbbc","user":{"login":"AtlassianPS","id":29664584,"avatar_url":"https://avatars3.githubusercontent.com/u/29664584?v=4","gravatar_id":"","url":"https://api.github.com/users/AtlassianPS","html_url":"https://github.com/AtlassianPS","followers_url":"https://api.github.com/users/AtlassianPS/followers","following_url":"https://api.github.com/users/AtlassianPS/following{/other_user}","gists_url":"https://api.github.com/users/AtlassianPS/gists{/gist_id}","starred_url":"https://api.github.com/users/AtlassianPS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AtlassianPS/subscriptions","organizations_url":"https://api.github.com/users/AtlassianPS/orgs","repos_url":"https://api.github.com/users/AtlassianPS/repos","events_url":"https://api.github.com/users/AtlassianPS/events{/privacy}","received_events_url":"https://api.github.com/users/AtlassianPS/received_events","type":"Organization","site_admin":false},"repo":{"id":46253066,"name":"ConfluencePS","full_name":"AtlassianPS/ConfluencePS","owner":{"login":"AtlassianPS","id":29664584,"avatar_url":"https://avatars3.githubusercontent.com/u/29664584?v=4","gravatar_id":"","url":"https://api.github.com/users/AtlassianPS","html_url":"https://github.com/AtlassianPS","followers_url":"https://api.github.com/users/AtlassianPS/followers","following_url":"https://api.github.com/users/AtlassianPS/following{/other_user}","gists_url":"https://api.github.com/users/AtlassianPS/gists{/gist_id}","starred_url":"https://api.github.com/users/AtlassianPS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AtlassianPS/subscriptions","organizations_url":"https://api.github.com/users/AtlassianPS/orgs","repos_url":"https://api.github.com/users/AtlassianPS/repos","events_url":"https://api.github.com/users/AtlassianPS/events{/privacy}","received_events_url":"https://api.github.com/users/AtlassianPS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AtlassianPS/ConfluencePS","description":"Confluence REST API (including Cloud) via PowerShell","fork":false,"url":"https://api.github.com/repos/AtlassianPS/ConfluencePS","forks_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/forks","keys_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/teams","hooks_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/hooks","issue_events_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/issues/events{/number}","events_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/events","assignees_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/assignees{/user}","branches_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/branches{/branch}","tags_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/tags","blobs_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/git/refs{/sha}","trees_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/statuses/{sha}","languages_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/languages","stargazers_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/stargazers","contributors_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/contributors","subscribers_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/subscribers","subscription_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/subscription","commits_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/commits{/sha}","git_commits_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/git/commits{/sha}","comments_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/comments{/number}","issue_comment_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/issues/comments{/number}","contents_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/contents/{+path}","compare_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/merges","archive_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/downloads","issues_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/issues{/number}","pulls_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/pulls{/number}","milestones_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/milestones{/number}","notifications_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/labels{/name}","releases_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/releases{/id}","deployments_url":"https://api.github.com/repos/AtlassianPS/ConfluencePS/deployments","created_at":"2015-11-16T05:01:51Z","updated_at":"2018-02-06T07:22:06Z","pushed_at":"2018-02-07T22:09:01Z","git_url":"git://github.com/AtlassianPS/ConfluencePS.git","ssh_url":"git@github.com:AtlassianPS/ConfluencePS.git","clone_url":"https://github.com/AtlassianPS/ConfluencePS.git","svn_url":"https://github.com/AtlassianPS/ConfluencePS","homepage":"https://AtlassianPS.org/module/ConfluencePS","size":402,"stargazers_count":37,"watchers_count":37,"language":"PowerShell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":34,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":7,"open_issues":34,"watchers":37,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AtlassianPS/ConfluencePS/pulls/123"},"html":{"href":"https://github.com/AtlassianPS/ConfluencePS/pull/123"},"issue":{"href":"https://api.github.com/repos/AtlassianPS/ConfluencePS/issues/123"},"comments":{"href":"https://api.github.com/repos/AtlassianPS/ConfluencePS/issues/123/comments"},"review_comments":{"href":"https://api.github.com/repos/AtlassianPS/ConfluencePS/pulls/123/comments"},"review_comment":{"href":"https://api.github.com/repos/AtlassianPS/ConfluencePS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AtlassianPS/ConfluencePS/pulls/123/commits"},"statuses":{"href":"https://api.github.com/repos/AtlassianPS/ConfluencePS/statuses/b38584cca7ca2296ea7a8f84adec57ef23858dca"}},"author_association":"NONE"}}
{"actor":{"display_login":"JohnAdders"}}