@@ -7,7 +7,7 @@ author: IEvangelist
7
7
manager : nitinme
8
8
ms.service : cognitive-services
9
9
ms.topic : conceptual
10
- ms.date : 03/18 /2020
10
+ ms.date : 03/23 /2020
11
11
ms.author : dapine
12
12
---
13
13
@@ -47,32 +47,50 @@ To set environment variables, use one the following commands - where the `ENVIRO
47
47
48
48
# [ Command Line] ( #tab/command-line )
49
49
50
+ Create and assign environment variable, given the value.
51
+
50
52
``` CMD
51
53
:: Assigns the env var to the value
52
- set ENVIRONMENT_VARIABLE_KEY=value
54
+ setx ENVIRONMENT_VARIABLE_KEY=value
55
+ ```
56
+
57
+ In a new instance of the ** Command Prompt** , read the environment variable.
53
58
59
+ ``` CMD
54
60
:: Prints the env var value
55
61
echo %ENVIRONMENT_VARIABLE_KEY%
56
62
```
57
63
58
64
# [ PowerShell] ( #tab/powershell )
59
65
66
+ Create and assign environment variable, given the value.
67
+
60
68
``` powershell
61
69
# Assigns the env var to the value
62
- $Env:ENVIRONMENT_VARIABLE_KEY="value"
70
+ [System.Environment]::SetEnvironmentVariable('ENVIRONMENT_VARIABLE_KEY', 'value', 'User')
71
+ ```
63
72
73
+ In a new instance of the ** Windows PowerShell** , read the environment variable.
74
+
75
+ ``` powershell
64
76
# Prints the env var value
65
- $Env: ENVIRONMENT_VARIABLE_KEY
77
+ [System.Environment]::GetEnvironmentVariable(' ENVIRONMENT_VARIABLE_KEY')
66
78
```
67
79
68
80
# [ Bash] ( #tab/bash )
69
81
82
+ Create and assign environment variable, given the value.
83
+
70
84
``` Bash
71
85
# Assigns the env var to the value
72
86
export ENVIRONMENT_VARIABLE_KEY=value
87
+ ```
88
+
89
+ In a new instance of the ** Bash** , read the environment variable.
73
90
91
+ ``` Bash
74
92
# Prints the env var value
75
- echo ENVIRONMENT_VARIABLE_KEY
93
+ echo " ${ ENVIRONMENT_VARIABLE_KEY} "
76
94
```
77
95
78
96
---
0 commit comments