Improving WDAC and Update exec

This commit is contained in:
2023-11-13 14:46:12 +01:00
parent 4d4d5f7f06
commit e26cb16124
4 changed files with 27 additions and 6 deletions

View File

@@ -1,7 +1,16 @@
function UpdateWindows {
Disable-WindowsOptionalFeature -online -NoRestart -FeatureName internet-explorer-optional-amd64
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 -AutoReboot
Install-WindowsUpdate -AcceptAll
}