
방금 제어판을 사용하여 Windows 10에서 몇 가지 변수를 설정했습니다.
변수: TWILIO_ACCOUNT_SID
변수 값:my_account_sid
변수: TWILIO_AUTH_TOKEN
변수 값:my_twilio_auth_token
refreshenv
나는 새로운 값을 볼 수 있도록 powershell에서 수행합니다 .
하지만 내가 할 때 :
Write-Output "$TWILIO_ACCOUNT_SID"
Write-Output "$TWILIO_ACCOUNT_SID"
값 대신 빈 줄이 나타납니다. 내가 도대체 뭘 잘못하고있는 겁니까?
답변1
Powershell에서는 ENV:VariableName
드라이브를 사용하여 환경 변수를 호출할 수 있습니다.
예:
Get-ChildItem ENV:systemroot
Name Value
---- -----
SystemRoot C:\WINDOWS
귀하의 경우에는 다음과 같이 부를 수 있습니다.Write-Output "ENV:TWILIO_ACCOUNT_SID"