winure/env-share/scripts/env-share.ps1

19 lines
298 B
PowerShell
Raw Normal View History

2024-07-08 10:12:46 -04:00
# make sure the file exists
$file = $env:ENV_SHARE_FILE
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