Octopus API Json output

Hi Team,

We have developed a custom .net application that creates a task in octopus using the script console to get the list of IIS app pools on our production servers.
We read the JSON response of the task to get the list of names. We have 6 production servers in total. The JSON output for for one of the servers has a different structure and this is causing our application to not display the results correctly.1 server.txt (1.7 KB)

We checked the api response using postman and chrome for all our servers.5 servers.txt (1023 Bytes)
All the servers are of the same configuration and we are running the same powershell commands on all of them.
Is there any particular reason why the JSON output would be different for just one server?
I know this is very confusing. :frowning: Any help is appreciated!


Hi Arun,

Thank you for getting in touch. Each log element represents a line of output received by the tentacle. For some reason, that tentacle got those three lines as a single line. This could be due to the Server OS version, PowerShell version or just the load on the server at that time. It could also be with how your script outputs the results.

Could you share the the (redacted) script you are running on the target?

Also, could you try writing reach line out using Write-Output? If that does not work, try Write-Highlight.

Hi Robert,

Thanks for your response. We are running a very simple script. It is as below.

Import-Module WebAdministration
$list = Get-ChildItem IIS:\Sites

The powershell version, windows OS are all same for all of our servers. That is why this issue is puzzling. I tried using Write-Host -NoNewline and it seems to work. We would like to know why this is happening.


Hi Arun,

Using Write-Output is the recommend method for writing output as it plays nicely with the way we capture output. It is likely a timing issue in how the PowerShell/Windows console output works.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.