{"action":"created","issue":{"url":"https://api.github.com/repos/Jaykul/BetterCredentials/issues/2","repository_url":"https://api.github.com/repos/Jaykul/BetterCredentials","labels_url":"https://api.github.com/repos/Jaykul/BetterCredentials/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/Jaykul/BetterCredentials/issues/2/comments","events_url":"https://api.github.com/repos/Jaykul/BetterCredentials/issues/2/events","html_url":"https://github.com/Jaykul/BetterCredentials/pull/2","id":162357328,"number":2,"title":"Test-Credential Feature","user":{"login":"jaspain","id":20157370,"avatar_url":"https://avatars.githubusercontent.com/u/20157370?v=3","gravatar_id":"","url":"https://api.github.com/users/jaspain","html_url":"https://github.com/jaspain","followers_url":"https://api.github.com/users/jaspain/followers","following_url":"https://api.github.com/users/jaspain/following{/other_user}","gists_url":"https://api.github.com/users/jaspain/gists{/gist_id}","starred_url":"https://api.github.com/users/jaspain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaspain/subscriptions","organizations_url":"https://api.github.com/users/jaspain/orgs","repos_url":"https://api.github.com/users/jaspain/repos","events_url":"https://api.github.com/users/jaspain/events{/privacy}","received_events_url":"https://api.github.com/users/jaspain/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-06-27T00:49:01Z","updated_at":"2016-06-27T17:29:29Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Jaykul/BetterCredentials/pulls/2","html_url":"https://github.com/Jaykul/BetterCredentials/pull/2","diff_url":"https://github.com/Jaykul/BetterCredentials/pull/2.diff","patch_url":"https://github.com/Jaykul/BetterCredentials/pull/2.patch"},"body":"`Test-Credential username` is intended to determine whether or not a credential corresponding to username exists in your credential vault, returning true or false accordingly. This is useful in unattended scripts, e.g. scripts run by the task scheduler, to invoke error handling as needed. `Get-Credential username` hangs execution of the script prompting for credentials if the requested credential is not in the vault."},"comment":{"url":"https://api.github.com/repos/Jaykul/BetterCredentials/issues/comments/228815413","html_url":"https://github.com/Jaykul/BetterCredentials/pull/2#issuecomment-228815413","issue_url":"https://api.github.com/repos/Jaykul/BetterCredentials/issues/2","id":228815413,"user":{"login":"jaspain","id":20157370,"avatar_url":"https://avatars.githubusercontent.com/u/20157370?v=3","gravatar_id":"","url":"https://api.github.com/users/jaspain","html_url":"https://github.com/jaspain","followers_url":"https://api.github.com/users/jaspain/followers","following_url":"https://api.github.com/users/jaspain/following{/other_user}","gists_url":"https://api.github.com/users/jaspain/gists{/gist_id}","starred_url":"https://api.github.com/users/jaspain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaspain/subscriptions","organizations_url":"https://api.github.com/users/jaspain/orgs","repos_url":"https://api.github.com/users/jaspain/repos","events_url":"https://api.github.com/users/jaspain/events{/privacy}","received_events_url":"https://api.github.com/users/jaspain/received_events","type":"User","site_admin":false},"created_at":"2016-06-27T17:29:29Z","updated_at":"2016-06-27T17:29:29Z","body":"Thanks, Joel. Here are my thoughts about this. You stated in the documentation that you want ultimately to move towards the approved PowerShell verb paradigms for credentials, e.g. Get/Set, Add (or New)/Remove. At the same time there is the conflicting desire to maintain backward compatibility with the built-in Get-Credential cmdlet, where “Get” is the only verb implemented.\r\n\r\nMaybe the best approach for now is to add a switch, e.g. -NoPrompt, to your Get-Credential function. For the greatest flexibility, return $Null and do a non-terminating Write-Error when the credential is not present. Then the end user could use a Try block for their own error-handling needs:\r\n\r\nTry {\r\n    Get-Credential $userName -NoPrompt -ErrorAction Stop\r\n}\r\nCatch {\r\n    #  My error handling code\r\n}\r\n\r\nConsider also leaving Test-Credential in place. Eventually there would be Get-, Set-, New-, Remove-, and Test-Credential, which would be analogous to Get-, Set-, New-, and Remove-Item along with Test-Path. The ultimate goal might be to create a new PSProvider called “Credential” with a “Vault” drive so that the *-Item native cmdlets themselves could be used with credentials.\r\n\r\nIn any event please move forward as you see fit, and thanks for developing BetterCredential. I use it all the time in my scheduled tasks.\r\n\r\nRegards, Jeff.\r\n\r\nFrom: Joel Bennett [mailto:notifications@github.com]\r\nSent: Monday, June 27, 2016 10:53 AM\r\nTo: Jaykul/BetterCredentials <BetterCredentials@noreply.github.com>\r\nCc: Jeffry A. Spain <jaspain@spainfamily.net>; Author <author@noreply.github.com>\r\nSubject: Re: [Jaykul/BetterCredentials] Test-Credential Feature (#2)\r\n\r\n\r\nThis looks great! Thanks.\r\n\r\nI didn't think of that. Perhaps we should add a switch to get-credential to just throw or Write-Error and return $null if it can't retrieve creds -- if I changed it that way, would you still want a separate Test command?\r\n\r\n—\r\nYou are receiving this because you authored the thread.\r\nReply to this email directly, view it on GitHub<https://github.com/Jaykul/BetterCredentials/pull/2#issuecomment-228805476>, or mute the thread<https://github.com/notifications/unsubscribe/ATOTuimcyETGWQxUZ-GsZi9w-inelNy-ks5qP__pgaJpZM4I-r5K>.\r\n"}}
{"actor":{"display_login":"jaspain"}}