Mitt script för att uppdatera Windows-maskiner

This commit is contained in:
2026-08-18 20:07:41 +02:00
parent 8546ca2129
commit daaa32e35f

36
uppdatera_windows.ps1 Normal file
View File

@@ -0,0 +1,36 @@
Write-Host "=== Windows-underhåll startar ===" -ForegroundColor Green
Write-Host "Uppdaterar Winget-källor..." -ForegroundColor Green
winget source update
Write-Host "Installerar Winget-uppdateringar..." -ForegroundColor Green
winget upgrade --all `
--accept-package-agreements `
--accept-source-agreements
Write-Host ""
Write-Host "Installerar Windows Updates..." -ForegroundColor Green
Import-Module PSWindowsUpdate -ErrorAction SilentlyContinue
Get-WindowsUpdate -Install -AcceptAll -IgnoreReboot
Write-Host ""
Write-Host "Diskutrymme:" -ForegroundColor Green
Get-PSDrive C
Write-Host ""
Write-Host "Kontrollerar om fler Winget-uppdateringar finns..." -ForegroundColor Green
winget upgrade
Write-Host ""
if (Get-WURebootStatus -Silent) {
Write-Host "⚠ Systemet behöver startas om." -ForegroundColor Yellow
}
Write-Host ""
Write-Host "=== Windows-underhåll klart ===" -ForegroundColor Green
``