dotfiles/vscode/.vscode/extensions/ms-python.python-2024.8.0/python_files/deactivate/powershell/deactivate.ps1
Errol Sancaktar ff17c17e23 vscode
2024-06-14 09:31:58 -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
}
}