Set Variable From Command Line
See original GitHub issueI’d like a way to pass a single variable (key:value pair) to Newman from the command line without needing additional JSON files. Currently I’m using -e to set my environment and -d to set initial values for a couple of variables. Each of these switches requires a JSON file. Rather than use -d I’d like to just pass my variable.
I want to be able to do something like this:
newman run MyAPI.postman_collection.json -e Local.postman_environment.json MyVariable
Where MyVariable is an environment variable that I would set from the command line (as opposed to from JSON).
Issue Analytics
- State:
- Created 7 years ago
- Reactions:7
- Comments:14 (4 by maintainers)
Top Results From Across the Web
Set - Environment Variable - Windows CMD - SS64.com
Prompt for user input ... The /P switch allows you to set a variable equal to a line of input entered by the...
Read more >set (environment variable) - Microsoft Learn
The set command assigns everything that follows the equal sign (=) to the value of the variable. Therefore, if you type set testVar=test^1...
Read more >How do I set an environment variable on the command line ...
The shell parses the whole command line and executes all variable substitutions, so the command line becomes · It creates the temp vars...
Read more >How to Change your Command Line Environment
Set the variable on its own line, then use it anywhere: $ SOMETHING="some value" $ echo $SOMETHING some value · Set the variable...
Read more >MS-DOS and Windows Command Line Set Command
The /P switch lets you set the value of a variable to a line of input entered by the user. Displays the specified...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@bkosborne
--env-var
option has been added in Newman v4.4.0.This is now possible with the
--global-var key=value
option.