Issue
I have a .env
file like this one:
TESTCASE_GROUP_SIZE=25
. . .
And I want to get its value (read it) into a .ps1
script.
How can I do it?
Solution
get-content test.env | foreach {
$name, $value = $_.split('=')
set-content env:\$name $value
}
assuming you mean "set one environment variable per line in the file".
Answered By - TessellatingHeckler Answer Checked By - David Goodson (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.