Forum Discussion
Karl-WE
Oct 15, 2022MVP
SUGGESTION: AzureMigrateInstaller.ps1 (Version: 10.3.0.0) - IE removal and Edge dependency
AzureMigrateInstaller.ps1 (Version: 10.3.0.0)
function UninstallInternetExplorer
{
if ((Get-WindowsOptionalFeature -Online -FeatureName "Internet-Explorer-Optional-amd64").State -eq "Disabled")
{
Log-Info "Internet Explorer has already been uninstalled. Skipping uninstallation and continuing..."
Log-Success "[OK]`n"
return
}
do
{
Log-InfoHighLight "The latest Azure Migrate appliance configuration manager is not supported on Internet Explorer 11 or lower."
Log-InfoHighLight "You can either uninstall Internet Explorer using this script and open the appliance URL https://$machineHostName`:44368 on any other browser except Internet Explorer."
Log-Input "Do you want to remove Internet Explorer browser from this machine now? This will force a machine reboot immediately. Press [Y] to continue with the uninstallation or [N] to manually uninstall Internet Explorer..."
$userChoice = Read-Host
}while ("y", "n" -NotContains $userChoice.Trim())
if ($userChoice.Trim() -eq "n")
{
$global:WarningCount++
Log-Error "Skipping IE uninstallation..."
Log-Warning "Warning #$global:WarningCount User Action Required - Remove Internet Explorer as the default browser and then launch Azure Migrate appliance configuration manager using the shortcut placed on the desktop.`n"
}
else
{
dism /online /disable-feature /featurename:Internet-Explorer-Optional-amd64 /NoRestart
# Restart the machine
shutdown -r -t 60 -f
Log-Success "[OK]"
Log-InfoHighLight 'Restarting machine $machineHostName in 60 seconds. To abort this restart execute "shutdown /a" - Not Recommended.'
# Exit the script as restart is pending.
exit 0
}
}
The script will call this function and remove IE from Windows Server. If the user chooses to do so, it causes an expected restart to finalize the removal.
The function is being called AFTER the cleanup and after all components have been installed. It will not the script resume where it left off before the restart.
Suggestion:
- make the cleanup of components (at every run of the script) optional
using WMIprovider is very slow, too and causes high CPU load.
- rehome the IE removal in the front of the script OR alternatively include a message that this is the last operation of the script and it does not need to be run again after the potential restart.
Please also include a clear warning that disabling IE, will break IE mode for Edge. It is prominently used for WSUS Update Import etc., not necessarily on a Hyper-V host though.
I do not see the reason why you remove IE, the package will also install MS Edge, if it does not already exist. Which is good enough.
No RepliesBe the first to reply