113 lines
4.3 KiB
Markdown
113 lines
4.3 KiB
Markdown
<p align="center">
|
|
<a href="https://techniverse.net">
|
|
<img src="https://assets.techniverse.net/f1/git/graphics/repo-techniverse-logo.png" alt="Techniverse Community" height="70" />
|
|
</a>
|
|
</p>
|
|
|
|
<h1 align="center">Windows Updater</h1>
|
|
|
|
<h4 align="center">
|
|
Automatisiertes Windows Update Management per PowerShell. Installiert Windows Updates, optional Winget-Pakete, und benachrichtigt per ntfy, E-Mail und/oder Microsoft Teams.
|
|
</h4>
|
|
|
|
<h6 align="center">
|
|
<a href="https://www.cleveradmin.de">🏰 Website</a>
|
|
·
|
|
<a href="https://techniverse.net">📰 Community</a>
|
|
·
|
|
<a href="https://social.techniverse.net/@donnerwolke">🐘 Mastodon</a>
|
|
·
|
|
<a href="https://matrix.to/#/#support:techniverse.net">💬 Support</a>
|
|
</h6>
|
|
<br><br>
|
|
|
|
|
|
**Repository:** [https://git.techniverse.net/scriptos/windows-updater](https://git.techniverse.net/scriptos/windows-updater)
|
|
|
|
## Features
|
|
|
|
- **Windows Updates** automatisch installieren via PSWindowsUpdate-Modul
|
|
- **Winget-Updates** optional (`winget upgrade --all`), automatische Erkennung der Verfügbarkeit
|
|
- **Benachrichtigungen** via ntfy, E-Mail und/oder Microsoft Teams (inkl. HTML-Report und Adaptive Cards)
|
|
- **Benachrichtigungs-Ereignisse** granular steuerbar (je Ereignis einzeln ein-/ausschaltbar)
|
|
- **Dry-Run Modus** zum Prüfen verfügbarer Updates ohne Installation
|
|
- **Update-Ausschlüsse** für bestimmte KBs oder Treiber-Updates
|
|
- **Retry-Logik** für fehlgeschlagene Updates (konfigurierbare Anzahl)
|
|
- **Service Watchdog** startet konfigurierte Dienste nach Updates automatisch neu (wenn kein Reboot nötig)
|
|
- **Log-Rotation** mit einer Datei pro Tag und konfigurierbarer Aufbewahrung
|
|
- **Update-History** als XLSX (mit ImportExcel-Modul) oder CSV-Fallback
|
|
- **WSUS-Erkennung** automatisch, inkl. Anzeige des WSUS-Servers
|
|
- **Reboot-Management** mit drei Modi: sofort, verzögert, oder zu bestimmter Uhrzeit
|
|
- **Pre-/Post-Update Hooks** für eigene Scripts vor und nach dem Update-Vorgang
|
|
- **OS-Erkennung** für Windows 10/11, Server 2016/2019/2022/2025
|
|
|
|
## Unterstützte Betriebssysteme
|
|
|
|
| OS | Windows Updates | Winget |
|
|
|---|---|---|
|
|
| Windows 10 | Ja | Ja (wenn installiert) |
|
|
| Windows 11 | Ja | Ja |
|
|
| Windows Server 2016 | Ja | Nein* |
|
|
| Windows Server 2019 | Ja | Nein* |
|
|
| Windows Server 2022 | Ja | Nein* |
|
|
| Windows Server 2025 | Ja | Nein* |
|
|
|
|
*Winget ist auf Servern standardmäßig nicht verfügbar. Wird es manuell installiert, erkennt das Script dies automatisch.
|
|
|
|
## Schnellstart
|
|
|
|
### 1. Repository klonen / Dateien kopieren
|
|
|
|
```powershell
|
|
git clone https://git.techniverse.net/scriptos/windows-updater.git C:\scripts\windows-updater
|
|
```
|
|
|
|
### 2. Konfiguration erstellen
|
|
|
|
```powershell
|
|
Copy-Item C:\scripts\windows-updater\config.example.ini C:\scripts\windows-updater\config.ini
|
|
```
|
|
|
|
Danach `config.ini` mit einem Texteditor öffnen und die gewünschten Werte anpassen. Siehe [Konfiguration](docs/configuration.md) für alle Optionen.
|
|
|
|
### 3. Script ausführen (als Administrator)
|
|
|
|
```powershell
|
|
powershell.exe -ExecutionPolicy Bypass -File "C:\scripts\windows-updater\windows-updater.ps1"
|
|
```
|
|
|
|

|
|
|
|
### 4. Optional: Aufgabenplanung einrichten
|
|
|
|
Für automatische Ausführung per Windows Aufgabenplanung siehe [Aufgabenplanung einrichten](docs/task-scheduler.md).
|
|
|
|
## Exit-Codes
|
|
|
|
| Code | Bedeutung |
|
|
|---|---|
|
|
| 0 | Erfolg (Updates installiert, keine Updates verfügbar, oder Dry-Run) |
|
|
| 1 | Fehler (Modul-Fehler, Config fehlt, Updates fehlgeschlagen) |
|
|
| 2 | Neustart erforderlich, aber Auto-Reboot ist deaktiviert |
|
|
|
|
## PSWindowsUpdate-Modul
|
|
|
|
Das Script versucht zuerst, das [PSWindowsUpdate](https://github.com/mgajda83/PSWindowsUpdate)-Modul online von der PowerShell Gallery zu installieren. Falls das nicht möglich ist (kein Internet, Firewall), wird automatisch die im Repository enthaltene Offline-Kopie verwendet.
|
|
|
|
## Dokumentation
|
|
|
|
- [Konfiguration](docs/configuration.md) - Alle INI-Optionen im Detail
|
|
- [Benachrichtigungen](docs/notifications.md) - ntfy und E-Mail einrichten
|
|
- [Aufgabenplanung](docs/task-scheduler.md) - Windows Task Scheduler Setup
|
|
- [Problembehandlung](docs/troubleshooting.md) - Häufige Fehler und Lösungen
|
|
|
|
<br><br>
|
|
<p align="center">
|
|
<img src="https://assets.techniverse.net/f1/git/graphics/gray0-catonline.svg" alt="">
|
|
</p>
|
|
|
|
<p align="center">
|
|
<sub>
|
|
© Patrick Asmus · Techniverse Network · <a href="./LICENSE">Lizenz</a>
|
|
</sub>
|
|
</p> |