v1.1: Update-UI mit Verlauf, Referenzeditor für Pakete, Referenzskript (automatische Versionsupdates mit POST-Integration)
This commit is contained in:
parent
029caa8565
commit
06515b8d43
8 changed files with 1412 additions and 148 deletions
41
send-update-log-win.ps1
Normal file
41
send-update-log-win.ps1
Normal file
|
@ -0,0 +1,41 @@
|
|||
# Konfiguration
|
||||
$apiUrl = "http://192.168.18.4:8000/api/updatecheck/"
|
||||
$apiToken = "9d207bf0-10f5-4d8f-a479-22ff5aeff8d1"
|
||||
|
||||
# Hostname und Zeit
|
||||
$hostname = $env:COMPUTERNAME
|
||||
$timestamp = (Get-Date).ToString("yyyy-MM-ddTHH:mm:sszzz")
|
||||
|
||||
# OS- und Kernel-Info
|
||||
$os = (Get-CimInstance Win32_OperatingSystem).Caption
|
||||
$kernel = (Get-CimInstance Win32_OperatingSystem).Version
|
||||
|
||||
# Installierte Pakete mit DisplayName
|
||||
$raw = Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* |
|
||||
Where-Object { $_.DisplayName -and ($_.DisplayName -match 'Python|OpenSSH|nginx') } |
|
||||
ForEach-Object { "$($_.DisplayName)=unknown" }
|
||||
|
||||
# Fallback
|
||||
if (-not $raw) {
|
||||
$raw = @("none=none")
|
||||
}
|
||||
|
||||
# Paketzeichenfolge zusammenbauen
|
||||
$packageString = "os=$os;kernel=$kernel;" + ($raw -join ";")
|
||||
|
||||
# Body zusammenbauen
|
||||
$body = "$hostname,$timestamp,$packageString"
|
||||
|
||||
# Header
|
||||
$headers = @{
|
||||
"Authorization" = "Bearer $apiToken"
|
||||
}
|
||||
|
||||
# Abschicken
|
||||
try {
|
||||
Invoke-RestMethod -Uri $apiUrl -Method Post -Headers $headers -Body $body
|
||||
Write-Host "✅ Update-Log gesendet von $hostname"
|
||||
}
|
||||
catch {
|
||||
Write-Warning "❌ Fehler beim Senden: $_"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue