Running EXE file with environment variable in path (PowerShell)

I want to run some executable on Windows using PowerShell. Path to this executable should be resolved with environment variable. For example running command C:\Windows\system32\cmd.exe as $Env:SystemRoot\system32\cmd.exe I have tried this option and it raises following exception At line:1 char:16 + $Env:SystemRoot\system32\cmd.exe + ~~~~~~~~~~~~~~~~~ Unexpected token ‘\system32\cmd.exe’ in expression or statement. + CategoryInfo : ParserError:… Read More Running EXE file with environment variable in path (PowerShell)

How do i view my environment variables in Windows 10 VS Code or PyCharm terminal?

I’m on Windows 10 trying to code in Python and store variables into environment variables. When I do ‘set example=123’, the command goes through with no issues that i can see, but when i go to type ‘set’ on its own so I can see what is stored, I get this: PS C:\Users\Abrahim\Desktop\New file> set… Read More How do i view my environment variables in Windows 10 VS Code or PyCharm terminal?

Changing the Lua command in CMD

I’ve just added Lua to my enviroment variables, but now, every time I need to run a lua command, I have to write lua52 main.lua. My question is, is there a way to change that command so that I can write lua main.lua instead? >Solution : Yes you can rename lua52.exe into lua.exe.

Why can't I perform conditionals on environment variables in a node.js application

When I execute this node.js application… if(process.env.ENV_ARG === "someValue") { console.log("conditional works…"); } else { console.log(`ENV_ARG => ${process.env.ENV_ARG}`); } with the following script… "scripts": { "dev": "SET ENV_ARG=someValue && node index.js" }, the output is: ENV_ARG => someValue I can’t understand why the if statement evaluates to false. When the contents of process.env.ENV_ARG are logged… Read More Why can't I perform conditionals on environment variables in a node.js application

Exporting multiple variables in a for loop

I am having trouble exporting multiple env variables in a for loop of a bash script. The full script looks something like: IFS_old="$IFS" IFS=’;’ test_data="secret1=’data1′;secret2=’data2′;secret3=’data3’" for secret in $test_data do eval "export $secret" done IFS="$IFS_old" So the input string consists of variables and their values separated by a semicolon. I loop through it and want… Read More Exporting multiple variables in a for loop

Docker compose won't use .env variables [NodeJS, Docker]

I want to use my env variable inside the docker compose file. When I try to run it I get this error for every variable in there like they weren’t defined: The password variable is not set. Defaulting to a blank string. Some context: Docker-compose: version: ‘3.3’ services: mysqldb: image: mysql:8 restart: always env_file: config.env… Read More Docker compose won't use .env variables [NodeJS, Docker]