Initialer Import der Synology Scripts

This commit is contained in:
root
2026-08-05 08:43:57 +02:00
commit 5e32a7c411
404 changed files with 79932 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
enum LogLevel {
INFO
WARN
ERROR
DEBUG
}
function Write-Log {
param(
[string]$Message,
[LogLevel]$Level = [LogLevel]::INFO
)
```
$ts = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
$line = "[$ts][$Level] $Message"
switch ($Level) {
"INFO" { Write-Host $line -ForegroundColor Gray }
"WARN" { Write-Host $line -ForegroundColor Yellow }
"ERROR" { Write-Host $line -ForegroundColor Red }
"DEBUG" { Write-Host $line -ForegroundColor DarkGray }
}
```
}