amrobot3 commited on
Commit
5cf5647
·
verified ·
1 Parent(s): 7f0059a

Delete env.ps1

Browse files
Files changed (1) hide show
  1. env.ps1 +0 -24
env.ps1 DELETED
@@ -1,24 +0,0 @@
1
- function Load-EnvVariables {
2
- param (
3
- [string]$EnvFilePath = ".\.env"
4
- )
5
-
6
- if (Test-Path -Path $EnvFilePath) {
7
- $envContent = Get-Content -Path $EnvFilePath
8
- foreach ($line in $envContent) {
9
- if ($line -notmatch '^\s*(#|$)') {
10
- $keyValue = $line -split '=', 2
11
- if ($keyValue.Length -eq 2) {
12
- $key = $keyValue[0].Trim()
13
- $value = $keyValue[1].Trim()
14
- Set-Item -Path "env:$key" -Value $value
15
- }
16
- }
17
- }
18
- } else {
19
- Write-Warning "未找到.env文件: $EnvFilePath"
20
- }
21
- }
22
-
23
- # 调用函数来加载环境变量
24
- Load-EnvVariables