Mitt script för att uppdatera Windows-maskiner
This commit is contained in:
1 parent
8546ca2129
commit
daaa32e35f
1 file changed
+36
@@ -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