Informatica - Is it possible to set a workflow variable in a command task without using a script? - sh

I have a file (X) which contains a single line specifying the location and name of another file (Y). X is captured within a workflow variable but Y isn't, and I need to pass Y as a parameter to a post SQL command in one of the sessions. Since this should be possible using a single line with basename $(head -n 1 $$X), I am hesitant to create a script specifically for this (also since there are no other scripts currently used).
Is there a way to assign the output of a command (the one specified above) to a workflow variable?

Related

What is the right syntac for `--set-env-vars` in gcloud and `.ps1` file to set multiple env variables when deploying Cloud Functions?

I'm trying to deploy a function using gcloud and powershell.
While doing that I want to set multiple environment variables.
Current script looks like this
--set-env-vars folder_id=$FOLDER_ID,SECRET_NAME=$SECRET_NAME,GCP_PROJECT=$PROJECTID
And this sets only 'folder_id' and takes all the strings after the first = including the rest of commas and equal signs as its value.
I know I can also use env-var-file but as you can see I want these values to be variables people can dynamically set.
What is the right syntax to do this?
So far I've tried,
# with quotation mark
--set-env-vars "folder_id=$FOLDER_ID,SECRET_NAME=$SECRET_NAME,GCP_PROJECT=$PROJECTID"
# with equal from the beginning
--set-env-vars=folder_id=$FOLDER_ID,SECRET_NAME=$SECRET_NAME,GCP_PROJECT=$PROJECTID
# with quotation mark AND equal from the beginning
--set-env-vars="folder_id=$FOLDER_ID,SECRET_NAME=$SECRET_NAME,GCP_PROJECT=$PROJECTID"
# with square brackets
--set-env-vars=[folder_id=$FOLDER_ID,SECRET_NAME=$SECRET_NAME,GCP_PROJECT=$PROJECTID]
# Passing an array of strings
$ENV_VARS = #("folder_id=$FOLDER_ID","SECRET_NAME=$SECRET_NAME","GCP_PROJECT=$PROJECTID")
--set-env-vars=$ENV_VARS
Before I would go on the path to parse env.yml file from .ps1 and then execute deploying code, I wanna give it one more shot by asking the question here.
Using a separate --set-env-vars for every variable like
--set-env-vars folder_id=$FOLDER_ID --set-env-vars SECRET_NAME=$SECRET_NAME
isn't an elegant solution but it works.

How to pass arguments from UFT to command line

I am trying to run tests in UFT by running a .vbs file. I am also passing arguments through command line. .vbs file reads the arguments and sets the environment variable of UFT. Hence, I can read them inside UFT.
qtApp.Test.Environment.Value("First_Argument") = WScript.Arguments.Item(0)
qtApp.Test.Environment.Value("Second_Argument") = WScript.Arguments.Item(1)
After that, I want to get a number as an output from UFT because I will use that output to pass it to the next command in command line.
The Test Parameters Object can be a way , more detailed in the Automation Object Documentation
You will have to define the TestParameters of the TestCase from the UFT IDE(manually) there is no way to define them automatically. If you declare them as in and out type, and change their value as a part of a Test Case, you would be able to read it afterwards from the vbs (Do not open a new Test Case until you did not read out the preferred values)
Although this is a working (and standard) way for exchanging parameters between the driver script and the TA Robot(UFT) I would advise you to use a simple file based way of doing this - managing test parameters can be very time consuming.
Tell the script via an Environment variable the path of the xml / json or simple text file where you expect the results to be written and when the test is done, read the content of the file (assuming the test will write into that file)
The plain old file way should not be underestimated especially in such circumstances.

Pass a Team City Parameter to a PowerShell file

I have the following parameter defined in Team City:
I want to pass this parameter into a powershell script I have (that will update the xml file with the version number).
But this inserts the actual text %version% into the script (No substitution is made for the actual value of the parameter.)
However, I know my script is working because if I hardcode the values like this then it works:
Is there a way to get %version% to convert to the actual value when when used as a PowerShell script argument?
If you put the parameter in quotes, "%version%", and change the script execution mode to Execute ps1 script with "-File" argument then this should resolve and inject correctly
e.g.
Hope this helps
You need Environment Variables (env.), it's work to me
enter image description here

How to send a command line command multiple times

I have been working on a project that uses a program called TeraTerm to send commands to a TV via a serial port. I have discovered that when I open the program manually after a reboot, I have to open the correct port and then send the .dat command file several times before it actually takes (Turns off the TV).
The commands I am using are from this page.
Anyway, I ran the command
TTERMPRO /C=7 /DS /FD=C:\Commands\TurnOffTest3.dat /FD=C:\Commands\TurnOffTest3.dat /FD=C:\Commands\TurnOffTest3.dat
hoping that it would allow me to send the file multiple times. The TeraTerm window did open as usual, but the file was either not sent or had no effect.
There is a very high likelyhood that I am sending the commands incorrectly, as I am very new to the command prompt itself. Is there a way that I can call the command to send a file multiple times? If I am not interpreting the interface given on the website correctly or even if the way I am using the commands is just flat out wrong, any and all advice is welcome.
Side note: yes, I am sure that the command file that I am sending is the correct one because when I send the file manually (i. e. use the GUI) the TV turns off as expected.
EDIT: I have tried sending the file with and without quotes in its name.
for /L %G in (1,1,3) do TTERMPRO …
Read more in FOR command:
If you are using the FOR command at the command line rather than
in a batch program, use just one percent sign: %G instead of
%%G.
Noticed in help information about system commands for /? as well: To use the FOR command in a batch program, specify %%variable instead of %variable. Variable names are case sensitive, so %i is different from %I.
==> for /?
Runs a specified command for each file in a set of files.
FOR %variable IN (set) DO command [command-parameters]
%variable Specifies a single letter replaceable parameter.
(set) Specifies a set of one or more files. Wildcards may be used.
command Specifies the command to carry out for each file.
command-parameters
Specifies parameters or switches for the specified command.
To use the FOR command in a batch program, specify %%variable instead
of %variable. Variable names are case sensitive, so %i is different
from %I.
…
Further reading in Syntax: Escape Characters, Delimiters and Quotes

How to set the execution order of several scripts/functions?

I have coded several scripts and I now want to program a MATLAB script that sets the execution order of the scripts. For example, my first script only includes the input variables that the second script requires for calculating certain outputs which are then transferred to a third function and these results are then plotted with the help of the fourth script. Now, my question is: How can I code a script to set the execution order so that I do not have to call each script beforehand?
You should create a fourth script. This script will call all of the scripts in the order you put them there. Matlab interprets a script in the order they are programmed...
script2;
script1;
script3;