diff --git a/README.md b/README.md index d030f29..16c88df 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,14 @@ Installation Script irm https://git.justw.tf/Lightemerald/setup-script/raw/branch/main/setupScript.ps1 | iex ``` +Windows Update +```ps +irm https://git.justw.tf/Lightemerald/setup-script/raw/branch/main/setupUpdate.ps1 | iex +UpdateWindows +``` + WDAC Installation Script ```ps irm https://git.justw.tf/Lightemerald/setup-script/raw/branch/main/setupWDAC.ps1 | iex +Show-WDACMenu ``` \ No newline at end of file diff --git a/setupScript.ps1 b/setupScript.ps1 index 6fcafee..f614b70 100644 --- a/setupScript.ps1 +++ b/setupScript.ps1 @@ -153,4 +153,11 @@ function Show-InstallationMenu { } while ($selection -ne "1" -and $selection -ne "2" -and $selection -ne "3") } -Show-InstallationMenu \ No newline at end of file +Show-InstallationMenu +Show-WDACMenu + +Write-Host "Would you like to restart now? (y/n)" +$input = Read-Host +if ($input -eq "y") { + Restart-Computer +} \ No newline at end of file diff --git a/setupUpdate.ps1 b/setupUpdate.ps1 index 5348713..1cc7e13 100644 --- a/setupUpdate.ps1 +++ b/setupUpdate.ps1 @@ -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 } \ No newline at end of file diff --git a/setupWDAC.ps1 b/setupWDAC.ps1 index 3855f21..d74e821 100644 --- a/setupWDAC.ps1 +++ b/setupWDAC.ps1 @@ -33,6 +33,4 @@ function Show-WDACMenu { default { Write-Host "Invalid selection. Please choose 1, 2, or 3." } } } while ($selection -ne "1" -and $selection -ne "2" -and $selection -ne "3") -} - -Show-WDACMenu \ No newline at end of file +} \ No newline at end of file