{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/vsts-tasks/issues/2983","repository_url":"https://api.github.com/repos/Microsoft/vsts-tasks","labels_url":"https://api.github.com/repos/Microsoft/vsts-tasks/issues/2983/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vsts-tasks/issues/2983/comments","events_url":"https://api.github.com/repos/Microsoft/vsts-tasks/issues/2983/events","html_url":"https://github.com/Microsoft/vsts-tasks/issues/2983","id":186199473,"number":2983,"title":"What is the correct way to debug your scripts in PowerShellOnTargetMachines?","user":{"login":"gregpakes","id":102243,"avatar_url":"https://avatars.githubusercontent.com/u/102243?v=3","gravatar_id":"","url":"https://api.github.com/users/gregpakes","html_url":"https://github.com/gregpakes","followers_url":"https://api.github.com/users/gregpakes/followers","following_url":"https://api.github.com/users/gregpakes/following{/other_user}","gists_url":"https://api.github.com/users/gregpakes/gists{/gist_id}","starred_url":"https://api.github.com/users/gregpakes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregpakes/subscriptions","organizations_url":"https://api.github.com/users/gregpakes/orgs","repos_url":"https://api.github.com/users/gregpakes/repos","events_url":"https://api.github.com/users/gregpakes/events{/privacy}","received_events_url":"https://api.github.com/users/gregpakes/received_events","type":"User","site_admin":false},"labels":[{"id":391088230,"url":"https://api.github.com/repos/Microsoft/vsts-tasks/labels/Area:%20Release","name":"Area: Release","color":"5319e7","default":false},{"id":154814016,"url":"https://api.github.com/repos/Microsoft/vsts-tasks/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":{"login":"chshrikh","id":11972852,"avatar_url":"https://avatars.githubusercontent.com/u/11972852?v=3","gravatar_id":"","url":"https://api.github.com/users/chshrikh","html_url":"https://github.com/chshrikh","followers_url":"https://api.github.com/users/chshrikh/followers","following_url":"https://api.github.com/users/chshrikh/following{/other_user}","gists_url":"https://api.github.com/users/chshrikh/gists{/gist_id}","starred_url":"https://api.github.com/users/chshrikh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chshrikh/subscriptions","organizations_url":"https://api.github.com/users/chshrikh/orgs","repos_url":"https://api.github.com/users/chshrikh/repos","events_url":"https://api.github.com/users/chshrikh/events{/privacy}","received_events_url":"https://api.github.com/users/chshrikh/received_events","type":"User","site_admin":false},"assignees":[{"login":"chshrikh","id":11972852,"avatar_url":"https://avatars.githubusercontent.com/u/11972852?v=3","gravatar_id":"","url":"https://api.github.com/users/chshrikh","html_url":"https://github.com/chshrikh","followers_url":"https://api.github.com/users/chshrikh/followers","following_url":"https://api.github.com/users/chshrikh/following{/other_user}","gists_url":"https://api.github.com/users/chshrikh/gists{/gist_id}","starred_url":"https://api.github.com/users/chshrikh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chshrikh/subscriptions","organizations_url":"https://api.github.com/users/chshrikh/orgs","repos_url":"https://api.github.com/users/chshrikh/repos","events_url":"https://api.github.com/users/chshrikh/events{/privacy}","received_events_url":"https://api.github.com/users/chshrikh/received_events","type":"User","site_admin":false}],"milestone":null,"comments":15,"created_at":"2016-10-31T04:11:48Z","updated_at":"2016-12-12T13:38:46Z","closed_at":null,"body":"I have a series of Powershell modules that I am executing with PowerShellOnTargetMachines.\r\n\r\nI am trying to see the debug statements within the VSTS build log, but I am having a real hard time getting them to come through.\r\n\r\nI understand that **Write-Host** is not recommended for automation, so my question is, what should I use?  I have tried **Write-Debug**, **Write-Verbose** and made sure the preferences are set right.  But when I call a function from the main script all my logging disappears.  The only output I can get to appear is **Write-Output** from the top most script.  I obviously can't use **Write-Output** from called functions as they may return a value.\r\n\r\nThis is possibly a more generic powershell question, but I am wondering if there are any best practices for use with this task?"},"comment":{"url":"https://api.github.com/repos/Microsoft/vsts-tasks/issues/comments/266432830","html_url":"https://github.com/Microsoft/vsts-tasks/issues/2983#issuecomment-266432830","issue_url":"https://api.github.com/repos/Microsoft/vsts-tasks/issues/2983","id":266432830,"user":{"login":"haydenhancock","id":625838,"avatar_url":"https://avatars.githubusercontent.com/u/625838?v=3","gravatar_id":"","url":"https://api.github.com/users/haydenhancock","html_url":"https://github.com/haydenhancock","followers_url":"https://api.github.com/users/haydenhancock/followers","following_url":"https://api.github.com/users/haydenhancock/following{/other_user}","gists_url":"https://api.github.com/users/haydenhancock/gists{/gist_id}","starred_url":"https://api.github.com/users/haydenhancock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haydenhancock/subscriptions","organizations_url":"https://api.github.com/users/haydenhancock/orgs","repos_url":"https://api.github.com/users/haydenhancock/repos","events_url":"https://api.github.com/users/haydenhancock/events{/privacy}","received_events_url":"https://api.github.com/users/haydenhancock/received_events","type":"User","site_admin":false},"created_at":"2016-12-12T13:38:46Z","updated_at":"2016-12-12T13:38:46Z","body":"@chshrikh As I mentioned, Write-Verbose works correctly outside of a conditional statement. I read up a bit more on these cmdlets and determined that I must set the $VerbosePreference variable to \"Continue\" in the script in order to get anything passed to the build log."}}
{"actor":{"display_login":"haydenhancock"}}