Network Automation Software
You are not currently logged on. You must be logged on in order to post. Log on
Or Create a new account
AutoMate Discussion
Decrease font size
Increase font size
Topic Title: Powershell: Output to variable
Topic Summary:
Created On: 04/18/2018 07:46 AM
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
 04/18/2018 07:46 AM
User is offline View Users Profile Print this message

Author Icon
TimoCordes
Apprentice (20-49)

Posts: 35
Joined: 04/12/2016

Hi Guys,

I use a powershell statement to manipulate json information with JQ. I actually read the json information from a file and store it to a file.
For the next step i planned to remove the read/write to the file and work directly with variables.
Actually the task send a http get and save the feedback into a variable.
Than i run a powershell action with jq to manipulate the json file. The powershell action only offers to store the result as dataset. It is possible to store the result directly to a variable? If not it is necessary to loop through the dataset and this tooks a longer time.

Regards
Timo
 04/23/2018 08:31 AM
User is offline View Users Profile Print this message

Author Icon
Leonard Amabile
HelpSystems

Posts: 5454
Joined: 05/15/2007

Timo,

Powershell outputs to a dataset. If it's just the one row then it would remove the need to loop the dataset. Is the script generating a multirow dataset?

-------------------------

Leonard Amabile | Director, Cross Platform Support
AutoMate | InterMapper | Skybot | Divisions of HelpSystems
T: +1.213.738.1700 | F: +1.213.738.7665


Edited: 05/17/2018 at 06:18 AM by Leonard Amabile
 05/16/2018 10:48 PM
User is offline View Users Profile Print this message

Author Icon
TimoCordes
Apprentice (20-49)

Posts: 35
Joined: 04/12/2016

Hi Leonard, yes the script generates several lines. But it has also the possibility to compact the Output (than it is a line). That is a Workaround. Thanks.

Regards
Timo
Statistics
18257 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 6686 on 11/01/2020 at 01:24 AM.
There are currently 912 guests browsing this forum, which makes a total of 912 users using this forum.

FuseTalk Enterprise Edition v4.0 - © 1999-2021 FuseTalk Inc. All rights reserved.

Sitemap Network Automation Software Blog