how can PowerShell returns an json array?
Is there a way that powershell return an json arry?
I have written a script, that gets aa json array from an restful api. but when i wrote Write-Output $result (the array of json), the return value of the powershell script is on "]" 😦
9 Replies
i found the answer in the docs 😉
output must writen to the file ./result.json
hm, but it does not work 😦
I will investigate, it should work
it seems that the result.json is not read as result of the step.
is there a working sample?
Did you write it at ./result.json ?
Or maybe somewhere else
Could you print the full path where you wrote
here a code snippet:
$jsonData = @{
"name" = "John Doe"
"age" = 30
"city" = "New York"
} | ConvertTo-Json
'# the last line of the stdout is the return value
$jsonData | Out-File -FilePath "./Result.json"
lowercase is not running also:
$jsonData | Out-File -FilePath "./result.json"
any news here? I have no idea what i can test here.
i've pushed a fix, it will be available in next version
okay, great.
yeah, it run's 🙂
can you gibe me a hint, how should the follow task? i have multiple powershell scripts that getting information from different api's, each script returns a json. should i create one workflow and put each of the script there or is it better to use multiple schedules with multiple workflows?
oh each workflow is only a powershell scipt and an "store to elasticsearch" python-script.