diff --git a/uppdatera_windows.ps1 b/uppdatera_windows.ps1 new file mode 100644 index 0000000..efb69d9 --- /dev/null +++ b/uppdatera_windows.ps1 @@ -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 +`` \ No newline at end of file