Network Automation Software We are currently migrating this forum
over to our HelpSystems domain. Please
post all new threads in our new
HelpSystems Community Portal.
Post to the HelpSystems Forum
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
18258 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 5551 on 01/08/2018 at 11:11 AM.
There are currently 464 guests browsing this forum, which makes a total of 464 users using this forum.

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

Sitemap Network Automation Software Blog