{"action":"created","comment":{"url":"https://api.github.com/repos/bosun-monitor/bosun/pulls/comments/66175356","id":66175356,"diff_hunk":"@@ -115,7 +116,12 @@ func (c *ProgramCollector) Init() {\n var setupExternalCommand = func(cmd *exec.Cmd) {}\n \n func (c *ProgramCollector) runProgram(dpchan chan<- *opentsdb.DataPoint) (progError error) {\n-\tcmd := exec.Command(c.Path)\n+\tvar cmd *exec.Cmd\n+\tif runtime.GOOS == \"windows\" && filepath.Ext(c.Path) == \".ps1\" {\n+\t\tcmd = exec.Command(\"powershell\", \"-NoProfile\", \"-ExecutionPolicy\", \"Bypass\", \"-File\", c.Path)","path":"cmd/scollector/collectors/program.go","position":15,"original_position":15,"commit_id":"d6e7267688a537547ae32846881121397a448b83","original_commit_id":"d6e7267688a537547ae32846881121397a448b83","user":{"login":"gbrayut","id":304401,"avatar_url":"https://avatars.githubusercontent.com/u/304401?v=3","gravatar_id":"","url":"https://api.github.com/users/gbrayut","html_url":"https://github.com/gbrayut","followers_url":"https://api.github.com/users/gbrayut/followers","following_url":"https://api.github.com/users/gbrayut/following{/other_user}","gists_url":"https://api.github.com/users/gbrayut/gists{/gist_id}","starred_url":"https://api.github.com/users/gbrayut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gbrayut/subscriptions","organizations_url":"https://api.github.com/users/gbrayut/orgs","repos_url":"https://api.github.com/users/gbrayut/repos","events_url":"https://api.github.com/users/gbrayut/events{/privacy}","received_events_url":"https://api.github.com/users/gbrayut/received_events","type":"User","site_admin":false},"body":"What do you think about adding -NoLogo and -NonInteractive here? We usually use those in our collector scripts.\r\n\r\nI think -ExecutionPolicy Bypass can fail on systems that [set it via GPO](https://absolute-sharepoint.com/2014/03/change-powershell-machinepolicy-execution-policy-windows-server-2012r2.html). Might be best to have this as optional either via an ENV var **SCOLLECTOR_PS_POLICY=byapss** or part of the scollector.toml config file. Or we can wait for someone to report an issue and address it at that time.\r\n","created_at":"2016-06-08T00:19:52Z","updated_at":"2016-06-08T00:19:52Z","html_url":"https://github.com/bosun-monitor/bosun/pull/1771#discussion_r66175356","pull_request_url":"https://api.github.com/repos/bosun-monitor/bosun/pulls/1771","_links":{"self":{"href":"https://api.github.com/repos/bosun-monitor/bosun/pulls/comments/66175356"},"html":{"href":"https://github.com/bosun-monitor/bosun/pull/1771#discussion_r66175356"},"pull_request":{"href":"https://api.github.com/repos/bosun-monitor/bosun/pulls/1771"}}},"pull_request":{"url":"https://api.github.com/repos/bosun-monitor/bosun/pulls/1771","id":72817381,"html_url":"https://github.com/bosun-monitor/bosun/pull/1771","diff_url":"https://github.com/bosun-monitor/bosun/pull/1771.diff","patch_url":"https://github.com/bosun-monitor/bosun/pull/1771.patch","issue_url":"https://api.github.com/repos/bosun-monitor/bosun/issues/1771","number":1771,"state":"open","locked":false,"title":"Adding .PS1 to supported program extensions and changing command exec…","user":{"login":"TrentScholl","id":740765,"avatar_url":"https://avatars.githubusercontent.com/u/740765?v=3","gravatar_id":"","url":"https://api.github.com/users/TrentScholl","html_url":"https://github.com/TrentScholl","followers_url":"https://api.github.com/users/TrentScholl/followers","following_url":"https://api.github.com/users/TrentScholl/following{/other_user}","gists_url":"https://api.github.com/users/TrentScholl/gists{/gist_id}","starred_url":"https://api.github.com/users/TrentScholl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TrentScholl/subscriptions","organizations_url":"https://api.github.com/users/TrentScholl/orgs","repos_url":"https://api.github.com/users/TrentScholl/repos","events_url":"https://api.github.com/users/TrentScholl/events{/privacy}","received_events_url":"https://api.github.com/users/TrentScholl/received_events","type":"User","site_admin":false},"body":"This PR explicitly adds .PS1 to the supported executable extensions list.\r\n\r\nIt also adds code to support execution of PowerShell scripts.\r\n\r\nResolves #1693","created_at":"2016-06-07T05:23:04Z","updated_at":"2016-06-08T00:19:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b1efa54479e3fdd8f50950a93463fce07e811959","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bosun-monitor/bosun/pulls/1771/commits","review_comments_url":"https://api.github.com/repos/bosun-monitor/bosun/pulls/1771/comments","review_comment_url":"https://api.github.com/repos/bosun-monitor/bosun/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bosun-monitor/bosun/issues/1771/comments","statuses_url":"https://api.github.com/repos/bosun-monitor/bosun/statuses/d6e7267688a537547ae32846881121397a448b83","head":{"label":"TrentScholl:upstream","ref":"upstream","sha":"d6e7267688a537547ae32846881121397a448b83","user":{"login":"TrentScholl","id":740765,"avatar_url":"https://avatars.githubusercontent.com/u/740765?v=3","gravatar_id":"","url":"https://api.github.com/users/TrentScholl","html_url":"https://github.com/TrentScholl","followers_url":"https://api.github.com/users/TrentScholl/followers","following_url":"https://api.github.com/users/TrentScholl/following{/other_user}","gists_url":"https://api.github.com/users/TrentScholl/gists{/gist_id}","starred_url":"https://api.github.com/users/TrentScholl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TrentScholl/subscriptions","organizations_url":"https://api.github.com/users/TrentScholl/orgs","repos_url":"https://api.github.com/users/TrentScholl/repos","events_url":"https://api.github.com/users/TrentScholl/events{/privacy}","received_events_url":"https://api.github.com/users/TrentScholl/received_events","type":"User","site_admin":false},"repo":{"id":55401660,"name":"bosun","full_name":"TrentScholl/bosun","owner":{"login":"TrentScholl","id":740765,"avatar_url":"https://avatars.githubusercontent.com/u/740765?v=3","gravatar_id":"","url":"https://api.github.com/users/TrentScholl","html_url":"https://github.com/TrentScholl","followers_url":"https://api.github.com/users/TrentScholl/followers","following_url":"https://api.github.com/users/TrentScholl/following{/other_user}","gists_url":"https://api.github.com/users/TrentScholl/gists{/gist_id}","starred_url":"https://api.github.com/users/TrentScholl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TrentScholl/subscriptions","organizations_url":"https://api.github.com/users/TrentScholl/orgs","repos_url":"https://api.github.com/users/TrentScholl/repos","events_url":"https://api.github.com/users/TrentScholl/events{/privacy}","received_events_url":"https://api.github.com/users/TrentScholl/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TrentScholl/bosun","description":"Time Series Alerting Framework","fork":true,"url":"https://api.github.com/repos/TrentScholl/bosun","forks_url":"https://api.github.com/repos/TrentScholl/bosun/forks","keys_url":"https://api.github.com/repos/TrentScholl/bosun/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TrentScholl/bosun/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TrentScholl/bosun/teams","hooks_url":"https://api.github.com/repos/TrentScholl/bosun/hooks","issue_events_url":"https://api.github.com/repos/TrentScholl/bosun/issues/events{/number}","events_url":"https://api.github.com/repos/TrentScholl/bosun/events","assignees_url":"https://api.github.com/repos/TrentScholl/bosun/assignees{/user}","branches_url":"https://api.github.com/repos/TrentScholl/bosun/branches{/branch}","tags_url":"https://api.github.com/repos/TrentScholl/bosun/tags","blobs_url":"https://api.github.com/repos/TrentScholl/bosun/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TrentScholl/bosun/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TrentScholl/bosun/git/refs{/sha}","trees_url":"https://api.github.com/repos/TrentScholl/bosun/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TrentScholl/bosun/statuses/{sha}","languages_url":"https://api.github.com/repos/TrentScholl/bosun/languages","stargazers_url":"https://api.github.com/repos/TrentScholl/bosun/stargazers","contributors_url":"https://api.github.com/repos/TrentScholl/bosun/contributors","subscribers_url":"https://api.github.com/repos/TrentScholl/bosun/subscribers","subscription_url":"https://api.github.com/repos/TrentScholl/bosun/subscription","commits_url":"https://api.github.com/repos/TrentScholl/bosun/commits{/sha}","git_commits_url":"https://api.github.com/repos/TrentScholl/bosun/git/commits{/sha}","comments_url":"https://api.github.com/repos/TrentScholl/bosun/comments{/number}","issue_comment_url":"https://api.github.com/repos/TrentScholl/bosun/issues/comments{/number}","contents_url":"https://api.github.com/repos/TrentScholl/bosun/contents/{+path}","compare_url":"https://api.github.com/repos/TrentScholl/bosun/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TrentScholl/bosun/merges","archive_url":"https://api.github.com/repos/TrentScholl/bosun/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TrentScholl/bosun/downloads","issues_url":"https://api.github.com/repos/TrentScholl/bosun/issues{/number}","pulls_url":"https://api.github.com/repos/TrentScholl/bosun/pulls{/number}","milestones_url":"https://api.github.com/repos/TrentScholl/bosun/milestones{/number}","notifications_url":"https://api.github.com/repos/TrentScholl/bosun/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TrentScholl/bosun/labels{/name}","releases_url":"https://api.github.com/repos/TrentScholl/bosun/releases{/id}","deployments_url":"https://api.github.com/repos/TrentScholl/bosun/deployments","created_at":"2016-04-04T10:10:45Z","updated_at":"2016-04-04T10:10:47Z","pushed_at":"2016-06-07T13:36:17Z","git_url":"git://github.com/TrentScholl/bosun.git","ssh_url":"git@github.com:TrentScholl/bosun.git","clone_url":"https://github.com/TrentScholl/bosun.git","svn_url":"https://github.com/TrentScholl/bosun","homepage":"http://bosun.org","size":48299,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"bosun-monitor:master","ref":"master","sha":"6337b9fdfaba84e3002656abb18c890b6a48a12f","user":{"login":"bosun-monitor","id":9555242,"avatar_url":"https://avatars.githubusercontent.com/u/9555242?v=3","gravatar_id":"","url":"https://api.github.com/users/bosun-monitor","html_url":"https://github.com/bosun-monitor","followers_url":"https://api.github.com/users/bosun-monitor/followers","following_url":"https://api.github.com/users/bosun-monitor/following{/other_user}","gists_url":"https://api.github.com/users/bosun-monitor/gists{/gist_id}","starred_url":"https://api.github.com/users/bosun-monitor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bosun-monitor/subscriptions","organizations_url":"https://api.github.com/users/bosun-monitor/orgs","repos_url":"https://api.github.com/users/bosun-monitor/repos","events_url":"https://api.github.com/users/bosun-monitor/events{/privacy}","received_events_url":"https://api.github.com/users/bosun-monitor/received_events","type":"Organization","site_admin":false},"repo":{"id":14410778,"name":"bosun","full_name":"bosun-monitor/bosun","owner":{"login":"bosun-monitor","id":9555242,"avatar_url":"https://avatars.githubusercontent.com/u/9555242?v=3","gravatar_id":"","url":"https://api.github.com/users/bosun-monitor","html_url":"https://github.com/bosun-monitor","followers_url":"https://api.github.com/users/bosun-monitor/followers","following_url":"https://api.github.com/users/bosun-monitor/following{/other_user}","gists_url":"https://api.github.com/users/bosun-monitor/gists{/gist_id}","starred_url":"https://api.github.com/users/bosun-monitor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bosun-monitor/subscriptions","organizations_url":"https://api.github.com/users/bosun-monitor/orgs","repos_url":"https://api.github.com/users/bosun-monitor/repos","events_url":"https://api.github.com/users/bosun-monitor/events{/privacy}","received_events_url":"https://api.github.com/users/bosun-monitor/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bosun-monitor/bosun","description":"Time Series Alerting Framework","fork":false,"url":"https://api.github.com/repos/bosun-monitor/bosun","forks_url":"https://api.github.com/repos/bosun-monitor/bosun/forks","keys_url":"https://api.github.com/repos/bosun-monitor/bosun/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bosun-monitor/bosun/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bosun-monitor/bosun/teams","hooks_url":"https://api.github.com/repos/bosun-monitor/bosun/hooks","issue_events_url":"https://api.github.com/repos/bosun-monitor/bosun/issues/events{/number}","events_url":"https://api.github.com/repos/bosun-monitor/bosun/events","assignees_url":"https://api.github.com/repos/bosun-monitor/bosun/assignees{/user}","branches_url":"https://api.github.com/repos/bosun-monitor/bosun/branches{/branch}","tags_url":"https://api.github.com/repos/bosun-monitor/bosun/tags","blobs_url":"https://api.github.com/repos/bosun-monitor/bosun/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bosun-monitor/bosun/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bosun-monitor/bosun/git/refs{/sha}","trees_url":"https://api.github.com/repos/bosun-monitor/bosun/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bosun-monitor/bosun/statuses/{sha}","languages_url":"https://api.github.com/repos/bosun-monitor/bosun/languages","stargazers_url":"https://api.github.com/repos/bosun-monitor/bosun/stargazers","contributors_url":"https://api.github.com/repos/bosun-monitor/bosun/contributors","subscribers_url":"https://api.github.com/repos/bosun-monitor/bosun/subscribers","subscription_url":"https://api.github.com/repos/bosun-monitor/bosun/subscription","commits_url":"https://api.github.com/repos/bosun-monitor/bosun/commits{/sha}","git_commits_url":"https://api.github.com/repos/bosun-monitor/bosun/git/commits{/sha}","comments_url":"https://api.github.com/repos/bosun-monitor/bosun/comments{/number}","issue_comment_url":"https://api.github.com/repos/bosun-monitor/bosun/issues/comments{/number}","contents_url":"https://api.github.com/repos/bosun-monitor/bosun/contents/{+path}","compare_url":"https://api.github.com/repos/bosun-monitor/bosun/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bosun-monitor/bosun/merges","archive_url":"https://api.github.com/repos/bosun-monitor/bosun/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bosun-monitor/bosun/downloads","issues_url":"https://api.github.com/repos/bosun-monitor/bosun/issues{/number}","pulls_url":"https://api.github.com/repos/bosun-monitor/bosun/pulls{/number}","milestones_url":"https://api.github.com/repos/bosun-monitor/bosun/milestones{/number}","notifications_url":"https://api.github.com/repos/bosun-monitor/bosun/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bosun-monitor/bosun/labels{/name}","releases_url":"https://api.github.com/repos/bosun-monitor/bosun/releases{/id}","deployments_url":"https://api.github.com/repos/bosun-monitor/bosun/deployments","created_at":"2013-11-15T00:12:27Z","updated_at":"2016-06-06T16:41:48Z","pushed_at":"2016-06-07T17:26:09Z","git_url":"git://github.com/bosun-monitor/bosun.git","ssh_url":"git@github.com:bosun-monitor/bosun.git","clone_url":"https://github.com/bosun-monitor/bosun.git","svn_url":"https://github.com/bosun-monitor/bosun","homepage":"http://bosun.org","size":57643,"stargazers_count":1823,"watchers_count":1823,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":257,"mirror_url":null,"open_issues_count":307,"forks":257,"open_issues":307,"watchers":1823,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bosun-monitor/bosun/pulls/1771"},"html":{"href":"https://github.com/bosun-monitor/bosun/pull/1771"},"issue":{"href":"https://api.github.com/repos/bosun-monitor/bosun/issues/1771"},"comments":{"href":"https://api.github.com/repos/bosun-monitor/bosun/issues/1771/comments"},"review_comments":{"href":"https://api.github.com/repos/bosun-monitor/bosun/pulls/1771/comments"},"review_comment":{"href":"https://api.github.com/repos/bosun-monitor/bosun/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bosun-monitor/bosun/pulls/1771/commits"},"statuses":{"href":"https://api.github.com/repos/bosun-monitor/bosun/statuses/d6e7267688a537547ae32846881121397a448b83"}}}}
{"actor":{"display_login":"gbrayut"}}