Mitt script för att uppdatera Windows-maskiner
This commit is contained in:
36
uppdatera_windows.ps1
Normal file
36
uppdatera_windows.ps1
Normal 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
|
||||||
|
``
|
||||||
Reference in New Issue
Block a user