2024-07-08 10:12:46 -04:00
|
|
|
|
|
|
|
# make sure the file exists
|
|
|
|
$file = $env:ENV_SHARE_FILE
|
2024-07-08 10:26:22 -04:00
|
|
|
if(-not (Test-Path $file)) {
|
2024-07-08 10:12:46 -04:00
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
|
|
|
# insert values into env
|
|
|
|
foreach($line in Get-Content $file) {
|
|
|
|
$parts = $line -split ' = '
|
|
|
|
$var = $parts[0]
|
|
|
|
$value = $parts[1]
|
|
|
|
Set-Item env:$var -Value $value
|
|
|
|
}
|
|
|
|
|
|
|
|
# delete the file
|
|
|
|
Remove-Item $file
|
|
|
|
|