demo-python/code/custom-vectorizer/scripts/init_azd_env.ps1 (8 lines of code) (raw):
Write-Host "Loading azd .env file from current environment"
foreach ($line in (& azd env get-values)) {
if ($line -match "([^=]+)=(.*)") {
$key = $matches[1]
$value = $matches[2] -replace '^"|"$'
[Environment]::SetEnvironmentVariable($key, $value)
}
}