16 lines
712 B
PowerShell
16 lines
712 B
PowerShell
function UpdateWindows {
|
|
Write-Host "Updating Windows..."
|
|
# Check if optional feature internet-explorer-optional-amd64 is installed
|
|
$ieFeature = Get-WindowsOptionalFeature -Online -FeatureName internet-explorer-optional-amd64
|
|
if ($ieFeature.State -eq "Enabled") {
|
|
Write-Host "Removing Internet Explorer."
|
|
Disable-WindowsOptionalFeature -online -NoRestart -FeatureName internet-explorer-optional-amd64
|
|
} else {
|
|
Write-Host "Internet Explorer is already disabled."
|
|
}
|
|
|
|
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
|
|
Install-Module -Name PSWindowsUpdate -Force
|
|
Get-WindowsUpdate -ForceInstall
|
|
Install-WindowsUpdate -AcceptAll
|
|
} |