I have an environment variable in PowerShell
$env.aws_password
and this holds the aws password and I need to pass this environment variable to javascript.
I am running the javascript file using
& '\path\to\ScriptRunner.exe' '\path\to\CognosGroupsExtract.js'
And in the Javscript file i am passing the environment variable
var password = "process.env.aws_password"
server.logon("username",password)
I am getting reference error as process is not defined and cannot install node. I cannot install anything in javascript and i have to pass password through memory. Is there any way ?
See: Pass Node.js environment variable with Windows PowerShell
process.envis specific to Node.js, you would need to pass the password through memory.Please try this and let me know if it helps.