{"action":"closed","number":8108,"pull_request":{"url":"https://api.github.com/repos/Azure/azure-powershell/pulls/8108","id":238205713,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM4MjA1NzEz","html_url":"https://github.com/Azure/azure-powershell/pull/8108","diff_url":"https://github.com/Azure/azure-powershell/pull/8108.diff","patch_url":"https://github.com/Azure/azure-powershell/pull/8108.patch","issue_url":"https://api.github.com/repos/Azure/azure-powershell/issues/8108","number":8108,"state":"closed","locked":false,"title":" Corrects error when full path does not exist in AzError.ps1 and AzureRMError.ps1","user":{"login":"ManagedUx","id":30127953,"node_id":"MDQ6VXNlcjMwMTI3OTUz","avatar_url":"https://avatars1.githubusercontent.com/u/30127953?v=4","gravatar_id":"","url":"https://api.github.com/users/ManagedUx","html_url":"https://github.com/ManagedUx","followers_url":"https://api.github.com/users/ManagedUx/followers","following_url":"https://api.github.com/users/ManagedUx/following{/other_user}","gists_url":"https://api.github.com/users/ManagedUx/gists{/gist_id}","starred_url":"https://api.github.com/users/ManagedUx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManagedUx/subscriptions","organizations_url":"https://api.github.com/users/ManagedUx/orgs","repos_url":"https://api.github.com/users/ManagedUx/repos","events_url":"https://api.github.com/users/ManagedUx/events{/privacy}","received_events_url":"https://api.github.com/users/ManagedUx/received_events","type":"User","site_admin":false},"body":"Although the error is trapped by the try/catch block\r\nthe error is added to $Error. If a script or runbook\r\nchecks the count or value of $Error this can cause\r\nan issue.\r\n\r\n<!-- DO NOT DELETE THIS TEMPLATE -->\r\n\r\n## Description\r\n\r\nWe recently update the azure modules on our hybrid worker.  The file StartupScripts\\AzureRmError.ps1 (duplicated in StartupScripts\\AzError.ps1) throws and exception if the full path (directory) does not already exist for any reason. This error is trapped by the try/catch but still manifests in the $Error collection. If the runbook, like ours, is checking the $Error collection as part of it's process verification this causes an issue. This behavior was not observed in prior versions.  This PR corrects the issue by first checking for and creating the full path prior to the New-Item commandlet attempting to create the file.\r\n\r\n## Checklist\r\n\r\n- [x] I have read the [_Submitting Changes_](https://github.com/Azure/azure-powershell/blob/master/CONTRIBUTING.md#submitting-changes) section of [`CONTRIBUTING.md`](https://github.com/Azure/azure-powershell/blob/master/CONTRIBUTING.md)\r\n- [X] The title of the PR is clear and informative\r\n- [X] The appropriate [change log has been updated](https://github.com/Azure/azure-powershell/blob/master/CONTRIBUTING.md#updating-the-change-log)\r\n- [X] The PR does not introduce [breaking changes](https://github.com/Azure/azure-powershell/blob/master/documentation/breaking-changes/breaking-changes-definition.md)\r\n- [NA] If applicable, the changes made in the PR have proper test coverage\r\n- [NA] For public API changes to cmdlets:\r\n    - [NA] the changes have gone through a [cmdlet design review](https://github.com/Azure/azure-powershell-cmdlet-review-pr) (Microsoft internal partners only)\r\n    - [NA] the cmdlet markdown files were [generated using the `platyPS` module](https://github.com/Azure/azure-powershell/blob/master/documentation/development-docs/help-generation.md)\r\n","created_at":"2018-12-12T22:35:00Z","updated_at":"2018-12-17T18:11:21Z","closed_at":"2018-12-17T18:11:20Z","merged_at":null,"merge_commit_sha":"fe853b80017fe0338980007088356332c2f7f82d","assignee":{"login":"ManagedUx","id":30127953,"node_id":"MDQ6VXNlcjMwMTI3OTUz","avatar_url":"https://avatars1.githubusercontent.com/u/30127953?v=4","gravatar_id":"","url":"https://api.github.com/users/ManagedUx","html_url":"https://github.com/ManagedUx","followers_url":"https://api.github.com/users/ManagedUx/followers","following_url":"https://api.github.com/users/ManagedUx/following{/other_user}","gists_url":"https://api.github.com/users/ManagedUx/gists{/gist_id}","starred_url":"https://api.github.com/users/ManagedUx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManagedUx/subscriptions","organizations_url":"https://api.github.com/users/ManagedUx/orgs","repos_url":"https://api.github.com/users/ManagedUx/repos","events_url":"https://api.github.com/users/ManagedUx/events{/privacy}","received_events_url":"https://api.github.com/users/ManagedUx/received_events","type":"User","site_admin":false},"assignees":[{"login":"ManagedUx","id":30127953,"node_id":"MDQ6VXNlcjMwMTI3OTUz","avatar_url":"https://avatars1.githubusercontent.com/u/30127953?v=4","gravatar_id":"","url":"https://api.github.com/users/ManagedUx","html_url":"https://github.com/ManagedUx","followers_url":"https://api.github.com/users/ManagedUx/followers","following_url":"https://api.github.com/users/ManagedUx/following{/other_user}","gists_url":"https://api.github.com/users/ManagedUx/gists{/gist_id}","starred_url":"https://api.github.com/users/ManagedUx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManagedUx/subscriptions","organizations_url":"https://api.github.com/users/ManagedUx/orgs","repos_url":"https://api.github.com/users/ManagedUx/repos","events_url":"https://api.github.com/users/ManagedUx/events{/privacy}","received_events_url":"https://api.github.com/users/ManagedUx/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Azure/azure-powershell/pulls/8108/commits","review_comments_url":"https://api.github.com/repos/Azure/azure-powershell/pulls/8108/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/8108/comments","statuses_url":"https://api.github.com/repos/Azure/azure-powershell/statuses/21395d47d8f96bd7b12843cd56c54659f625fc6c","head":{"label":"ManagedUx:NewItemErrorFix","ref":"NewItemErrorFix","sha":"21395d47d8f96bd7b12843cd56c54659f625fc6c","user":{"login":"ManagedUx","id":30127953,"node_id":"MDQ6VXNlcjMwMTI3OTUz","avatar_url":"https://avatars1.githubusercontent.com/u/30127953?v=4","gravatar_id":"","url":"https://api.github.com/users/ManagedUx","html_url":"https://github.com/ManagedUx","followers_url":"https://api.github.com/users/ManagedUx/followers","following_url":"https://api.github.com/users/ManagedUx/following{/other_user}","gists_url":"https://api.github.com/users/ManagedUx/gists{/gist_id}","starred_url":"https://api.github.com/users/ManagedUx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManagedUx/subscriptions","organizations_url":"https://api.github.com/users/ManagedUx/orgs","repos_url":"https://api.github.com/users/ManagedUx/repos","events_url":"https://api.github.com/users/ManagedUx/events{/privacy}","received_events_url":"https://api.github.com/users/ManagedUx/received_events","type":"User","site_admin":false},"repo":{"id":161550488,"node_id":"MDEwOlJlcG9zaXRvcnkxNjE1NTA0ODg=","name":"azure-powershell","full_name":"ManagedUx/azure-powershell","private":false,"owner":{"login":"ManagedUx","id":30127953,"node_id":"MDQ6VXNlcjMwMTI3OTUz","avatar_url":"https://avatars1.githubusercontent.com/u/30127953?v=4","gravatar_id":"","url":"https://api.github.com/users/ManagedUx","html_url":"https://github.com/ManagedUx","followers_url":"https://api.github.com/users/ManagedUx/followers","following_url":"https://api.github.com/users/ManagedUx/following{/other_user}","gists_url":"https://api.github.com/users/ManagedUx/gists{/gist_id}","starred_url":"https://api.github.com/users/ManagedUx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManagedUx/subscriptions","organizations_url":"https://api.github.com/users/ManagedUx/orgs","repos_url":"https://api.github.com/users/ManagedUx/repos","events_url":"https://api.github.com/users/ManagedUx/events{/privacy}","received_events_url":"https://api.github.com/users/ManagedUx/received_events","type":"User","site_admin":false},"html_url":"https://github.com/ManagedUx/azure-powershell","description":"Microsoft Azure PowerShell","fork":true,"url":"https://api.github.com/repos/ManagedUx/azure-powershell","forks_url":"https://api.github.com/repos/ManagedUx/azure-powershell/forks","keys_url":"https://api.github.com/repos/ManagedUx/azure-powershell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ManagedUx/azure-powershell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ManagedUx/azure-powershell/teams","hooks_url":"https://api.github.com/repos/ManagedUx/azure-powershell/hooks","issue_events_url":"https://api.github.com/repos/ManagedUx/azure-powershell/issues/events{/number}","events_url":"https://api.github.com/repos/ManagedUx/azure-powershell/events","assignees_url":"https://api.github.com/repos/ManagedUx/azure-powershell/assignees{/user}","branches_url":"https://api.github.com/repos/ManagedUx/azure-powershell/branches{/branch}","tags_url":"https://api.github.com/repos/ManagedUx/azure-powershell/tags","blobs_url":"https://api.github.com/repos/ManagedUx/azure-powershell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ManagedUx/azure-powershell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ManagedUx/azure-powershell/git/refs{/sha}","trees_url":"https://api.github.com/repos/ManagedUx/azure-powershell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ManagedUx/azure-powershell/statuses/{sha}","languages_url":"https://api.github.com/repos/ManagedUx/azure-powershell/languages","stargazers_url":"https://api.github.com/repos/ManagedUx/azure-powershell/stargazers","contributors_url":"https://api.github.com/repos/ManagedUx/azure-powershell/contributors","subscribers_url":"https://api.github.com/repos/ManagedUx/azure-powershell/subscribers","subscription_url":"https://api.github.com/repos/ManagedUx/azure-powershell/subscription","commits_url":"https://api.github.com/repos/ManagedUx/azure-powershell/commits{/sha}","git_commits_url":"https://api.github.com/repos/ManagedUx/azure-powershell/git/commits{/sha}","comments_url":"https://api.github.com/repos/ManagedUx/azure-powershell/comments{/number}","issue_comment_url":"https://api.github.com/repos/ManagedUx/azure-powershell/issues/comments{/number}","contents_url":"https://api.github.com/repos/ManagedUx/azure-powershell/contents/{+path}","compare_url":"https://api.github.com/repos/ManagedUx/azure-powershell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ManagedUx/azure-powershell/merges","archive_url":"https://api.github.com/repos/ManagedUx/azure-powershell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ManagedUx/azure-powershell/downloads","issues_url":"https://api.github.com/repos/ManagedUx/azure-powershell/issues{/number}","pulls_url":"https://api.github.com/repos/ManagedUx/azure-powershell/pulls{/number}","milestones_url":"https://api.github.com/repos/ManagedUx/azure-powershell/milestones{/number}","notifications_url":"https://api.github.com/repos/ManagedUx/azure-powershell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ManagedUx/azure-powershell/labels{/name}","releases_url":"https://api.github.com/repos/ManagedUx/azure-powershell/releases{/id}","deployments_url":"https://api.github.com/repos/ManagedUx/azure-powershell/deployments","created_at":"2018-12-12T22:00:44Z","updated_at":"2018-12-12T22:01:43Z","pushed_at":"2018-12-13T00:20:17Z","git_url":"git://github.com/ManagedUx/azure-powershell.git","ssh_url":"git@github.com:ManagedUx/azure-powershell.git","clone_url":"https://github.com/ManagedUx/azure-powershell.git","svn_url":"https://github.com/ManagedUx/azure-powershell","homepage":null,"size":819968,"stargazers_count":0,"watchers_count":0,"language":"C#","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":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Azure:master","ref":"master","sha":"e250ae421a78942c7bef491d0da1a890d9a37228","user":{"login":"Azure","id":6844498,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NDQ0OTg=","avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","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,"node_id":"MDEwOlJlcG9zaXRvcnkyMzg5MTE5NA==","name":"azure-powershell","full_name":"Azure/azure-powershell","private":false,"owner":{"login":"Azure","id":6844498,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NDQ0OTg=","avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","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},"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":"2018-12-17T17:53:30Z","pushed_at":"2018-12-17T18:00:00Z","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":822800,"stargazers_count":1250,"watchers_count":1250,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1314,"mirror_url":null,"archived":false,"open_issues_count":739,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":1314,"open_issues":739,"watchers":1250,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-powershell/pulls/8108"},"html":{"href":"https://github.com/Azure/azure-powershell/pull/8108"},"issue":{"href":"https://api.github.com/repos/Azure/azure-powershell/issues/8108"},"comments":{"href":"https://api.github.com/repos/Azure/azure-powershell/issues/8108/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/azure-powershell/pulls/8108/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/8108/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/azure-powershell/statuses/21395d47d8f96bd7b12843cd56c54659f625fc6c"}},"author_association":"NONE","merged":false,"mergeable":false,"rebaseable":false,"mergeable_state":"dirty","merged_by":null,"comments":9,"review_comments":1,"maintainer_can_modify":false,"commits":3,"additions":11,"deletions":3,"changed_files":3}}
{"actor":{"display_login":"markcowl"}}