dotfiles/vscode/.vscode/extensions/ms-python.python-2024.12.1-linux-x64/python_files/deactivate/powershell/deactivate.ps1
2024-08-02 10:42:24 -06:00

12 lines
403 B
PowerShell

# Load dotenv-style file and restore environment variables
Get-Content -Path "$PSScriptRoot\envVars.txt" | ForEach-Object {
# Split each line into key and value at the first '='
$parts = $_ -split '=', 2
if ($parts.Count -eq 2) {
$key = $parts[0].Trim()
$value = $parts[1].Trim()
# Set the environment variable
Set-Item -Path "env:$key" -Value $value
}
}