From daaa32e35f82ffb1446a4b9a6ee524ef62d6215d Mon Sep 17 00:00:00 2001 From: Christian Ohlsson Date: Tue, 18 Aug 2026 20:07:41 +0200 Subject: [PATCH] =?UTF-8?q?Mitt=20script=20f=C3=B6r=20att=20uppdatera=20Wi?= =?UTF-8?q?ndows-maskiner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uppdatera_windows.ps1 | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 uppdatera_windows.ps1 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