Add choco-auto-update.ps1
This commit is contained in:
12
choco-auto-update.ps1
Normal file
12
choco-auto-update.ps1
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# MABDC Chocolatey Auto-Update Script
|
||||||
|
# Runs nightly at 2:00 AM via scheduled task
|
||||||
|
$LogFile = "C:\MABDC\Logs\auto-update.log"
|
||||||
|
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
|
||||||
|
Add-Content -Path $LogFile -Value "[$timestamp] Starting auto-update..."
|
||||||
|
|
||||||
|
try {
|
||||||
|
$result = choco upgrade all -y --source=mabdc --no-progress 2>&1
|
||||||
|
Add-Content -Path $LogFile -Value "[$timestamp] Update complete: $result"
|
||||||
|
} catch {
|
||||||
|
Add-Content -Path $LogFile -Value "[$timestamp] ERROR: $_"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user