Files
glpi-ai-agent/run.ps1
jbergner 9b3227348d
All checks were successful
release-tag / release-image (push) Successful in 1m33s
init
2026-07-27 17:32:35 +02:00

35 lines
845 B
PowerShell

$ErrorActionPreference = "Stop"
$envFile = Join-Path $PSScriptRoot ".env"
if (-not (Test-Path $envFile)) {
throw "Keine .env-Datei gefunden: $envFile"
}
Get-Content $envFile | ForEach-Object {
$line = $_.Trim()
if ($line -and -not $line.StartsWith("#")) {
$parts = $line -split "=", 2
if ($parts.Count -eq 2) {
$name = $parts[0].Trim()
$value = $parts[1].Trim()
if (
($value.StartsWith('"') -and $value.EndsWith('"')) -or
($value.StartsWith("'") -and $value.EndsWith("'"))
) {
$value = $value.Substring(1, $value.Length - 2)
}
[Environment]::SetEnvironmentVariable(
$name,
$value,
"Process"
)
}
}
}
go run .\cmd\agent