Also this package is for Internet Explorer 11 so I’m not sure a method of uninstall would be applicable. I guess since it’s an “update”.
This is my script here:
<pre class=“brush: powershell; gutter: true; first-line: 1; highlight: []; html-script: false”>
[CmdletBinding()]
Param (
[Parameter(Mandatory=$false)]
[ValidateSet('Install','Uninstall')]
[string]$DeploymentType = 'Install',
[Parameter(Mandatory=$false)]
[ValidateSet('Interactive','Silent','NonInteractive')]
[string]$DeployMode = 'Interactive',
[Parameter(Mandatory=$false)]
[switch]$AllowRebootPassThru = $false,
[Parameter(Mandatory=$false)]
[switch]$TerminalServerMode = $false,
[Parameter(Mandatory=$false)]
[switch]$DisableLogging = $false
)
Try {
## Set the script execution policy for this process
Try { Set-ExecutionPolicy -ExecutionPolicy 'ByPass' -Scope 'Process' -Force -ErrorAction 'Stop' } Catch {}
##*===============================================
##* VARIABLE DECLARATION
##*===============================================
## Variables: Application
[string]$appVendor = 'Microsoft'
[string]$appName = 'Internet Explorer'
[string]$appVersion = '11'
[string]$appArch = ''
[string]$appLang = 'EN'
[string]$appRevision = '01'
[string]$appScriptVersion = '1.0.0'
[string]$appScriptDate = '09/08/2016'
[string]$appScriptAuthor = 'IT'
##*===============================================
## Variables: Install Titles (Only set here to override defaults set by the toolkit)
[string]$installName = ''
[string]$installTitle = ''
##* Do not modify section below
#region DoNotModify
## Variables: Exit Code
[int32]$mainExitCode = 0
## Variables: Script
[string]$deployAppScriptFriendlyName = 'Deploy Application'
[version]$deployAppScriptVersion = [version]'3.6.8'
[string]$deployAppScriptDate = '02/06/2016'
[hashtable]$deployAppScriptParameters = $psBoundParameters
## Variables: Environment
If (Test-Path -LiteralPath 'variable:HostInvocation') { $InvocationInfo = $HostInvocation } Else { $InvocationInfo = $MyInvocation }
[string]$scriptDirectory = Split-Path -Path $InvocationInfo.MyCommand.Definition -Parent
## Dot source the required App Deploy Toolkit Functions
Try {
[string]$moduleAppDeployToolkitMain = "$scriptDirectory\AppDeployToolkit\AppDeployToolkitMain.ps1"
If (-not (Test-Path -LiteralPath $moduleAppDeployToolkitMain -PathType 'Leaf')) { Throw "Module does not exist at the specified location [$moduleAppDeployToolkitMain]." }
If ($DisableLogging) { . $moduleAppDeployToolkitMain -DisableLogging } Else { . $moduleAppDeployToolkitMain }
}
Catch {
If ($mainExitCode -eq 0){ [int32]$mainExitCode = 60008 }
Write-Error -Message "Module [$moduleAppDeployToolkitMain] failed to load: <code>n$($_.Exception.Message)</code>n `n$($_.InvocationInfo.PositionMessage)" -ErrorAction 'Continue'
## Exit the script, returning the exit code to SCCM
If (Test-Path -LiteralPath 'variable:HostInvocation') { $script:ExitCode = $mainExitCode; Exit } Else { Exit $mainExitCode }
}
#endregion
##* Do not modify section above
##*===============================================
##* END VARIABLE DECLARATION
##*===============================================
If ($deploymentType -ine 'Uninstall') {
##*===============================================
##* PRE-INSTALLATION
##*===============================================
[string]$installPhase = 'Pre-Installation'
## Show Welcome Message, close Internet Explorer if required, allow up to 3 deferrals, verify there is enough disk space to complete the install, and persist the prompt
Show-InstallationWelcome -CloseApps 'iexplore' -AllowDefer -DeferTimes 3 -CheckDiskSpace -PersistPrompt
## Show Progress Message (with the default message)
Show-InstallationProgress -StatusMessage "Internet Explorer 11 installation in Progress...<code>nThe installation should take fewer than 10 minutes to complete.</code>nA reboot will be required, so please save any work you have open at this time."
## <Perform Pre-Installation tasks here>
function IsInstalled($hotfixid)
{
$ret = $false
Get-WmiObject -Query "Select * from Win32_QuickFixEngineering WHERE HotfixID = '$hotfixid'" -Namespace "root\CIMV2" | ForEach-Object {
$ret = $true
}
return $ret
}
##===============================================##===============================================
##===============================================
## Prerequisite 1
##*===============================================
$update1 = "KB2834140"
If (IsInstalled($update1))
{
write-log -Message "$update1 is already installed, skipping." -source 'Isinstalled' -Logtype 'Legacy'
}
Else
{
Write-log -Message "Installing $update1…" -source 'Isinstalled' -Logtype 'Legacy'
cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\Windows6.1-KB2834140-v2-x86.cab /quiet /norestart"
}
##===============================================
## Prerequisite #2
##*===============================================
$update2 = "KB2670838"
If (IsInstalled($update2))
{
write-log -Message "$update2 is already installed, skipping." -source 'Isinstalled' -Logtype 'Legacy'
}
Else
{
write-log -Message "Installing $update2…" -source 'Isinstalled' -Logtype 'Legacy'
cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\KB2670838_x86.CAB /quiet /norestart"
}
##===============================================
## Prerequisite #3
##*===============================================
$update3 = "KB2639308"
If (IsInstalled($update3))
{
write-log -Message "$update2 is already installed, skipping." -source 'Isinstalled' -Logtype 'Legacy'
}
Else
{
write-log -Message "Installing $update2…" -source 'Isinstalled' -Logtype 'Legacy'
cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\KB2639308_x86.CAB /quiet /norestart"
}
##===============================================
## Prerequisite 4
##*===============================================
$update4 = "KB2731771"
If (IsInstalled($update4))
{
write-log -Message "$update4 is already installed, skipping." -source 'Isinstalled' -Logtype 'Legacy'
}
Else
{
write-log -Message "Installing $update4…" -source 'Isinstalled' -Logtype 'Legacy'
cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\KB2731771_x86.CAB /quiet /norestart"
}
##===============================================
## Prerequisite #5
##*===============================================
$update5 = "KB2729094"
If (IsInstalled($update5))
{
write-log -Message "$update5 is already installed, skipping." -source 'Isinstalled' -Logtype 'Legacy'
}
Else
{
write-log -Message "Installing $update5…" -source 'Isinstalled' -Logtype 'Legacy'
cmd.exe /c " C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\Windows6.1-KB2729094-v2-x86.cab /quiet /norestart"
}
##===============================================
## Prerequisite #6
##*===============================================
$update6 = "KB2786081"
If (IsInstalled($update6))
{
write-log -Message "$update6 is already installed, skipping." -source 'Isinstalled' -Logtype 'Legacy'
}
Else
{
write-log -Message "Installing $update6…" -source 'Isinstalled' -Logtype 'Legacy'
cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\KB2786081_x86.CAB /quiet /norestart"
}
##===============================================
## Prerequisite 7
##*===============================================
$update7 = "KB2888049"
If (IsInstalled($update7))
{
write-log -Message "$update7 is already installed, skipping." -source 'Isinstalled' -Logtype 'Legacy'
}
Else
{
write-log -Message "Installing $update7…" -source 'Isinstalled' -Logtype 'Legacy'
cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\Windows6.1-KB2888049-x86.cab /quiet /norestart"
}
##===============================================
## Prerequisite 8
##*===============================================
$update8 = "KB2882822"
If (IsInstalled($update8))
{
write-log -Message "$update8 is already installed, skipping." -source 'Isinstalled' -Logtype 'Legacy'
}
Else
{
write-log -Message "Installing $update8…" -source 'Isinstalled' -Logtype 'Legacy'
cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\Windows6.1-KB2882822-x86.cab /quiet /norestart"
}
##===============================================##===============================================
##*===============================================
##* INSTALLATION
##*===============================================
[string]$installPhase = 'Installation'
## Handle Zero-Config MSI Installations
If ($useDefaultMsi) {
[hashtable]$ExecuteDefaultMSISplat = @{ Action = 'Install'; Path = $defaultMsiFile }; If ($defaultMstFile) { $ExecuteDefaultMSISplat.Add('Transform', $defaultMstFile) }
Execute-MSI @ExecuteDefaultMSISplat; If ($defaultMspFiles) { $defaultMspFiles | ForEach-Object { Execute-MSI -Action 'Patch' -Path $_ } }
}
## <Perform Installation tasks here>
write-log -Message "Installing IE11" -source 'Isinstalled' -Logtype 'Legacy'
cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\IE-Win7.cab /quiet /norestart"
write-log -Message "Installing Spelling package" -source 'Isinstalled' -Logtype 'Legacy'
cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\Windows6.3-KB2849696-x86.cab /quiet /norestart"
write-log -Message "Installing Hyphenation package" -source 'Isinstalled' -Logtype 'Legacy'
cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\Windows6.3-KB2849697-x86.cab /quiet /norestart"
##*===============================================
##* POST-INSTALLATION
##*===============================================
[string]$installPhase = 'Post-Installation'
## <Perform Post-Installation tasks here>
write-log -Message "Installing IE11 CU Aug Update" -source 'Isinstalled' -Logtype 'Legacy'
cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\IE11-Windows6.1-KB3175443-x64.cab /quiet /norestart"
## Display a message at the end of the install
# If (-not $useDefaultMsi) { Show-InstallationPrompt -Message 'Internet Explorer 11 upgrade is complete.' -ButtonRightText 'OK' -Icon Information -NoWait }
Show-DialogBox -Title 'Internet Explorer 11 installation Complete' -Text 'Internet Explorer 11 installation has completed. Please click OK and restart your computer.' -Icon 'Information'
Show-InstallationRestartPrompt -Countdownseconds 600 -CountdownNoHideSeconds 60
}
ElseIf ($deploymentType -ieq 'Uninstall')
{
##*===============================================
##* PRE-UNINSTALLATION
##*===============================================
[string]$installPhase = 'Pre-Uninstallation'
## Show Welcome Message, close Internet Explorer with a 60 second countdown before automatically closing
Show-InstallationWelcome -CloseApps 'iexplore' -CloseAppsCountdown 60
## Show Progress Message (with the default message)
Show-InstallationProgress
## <Perform Pre-Uninstallation tasks here>
##*===============================================
##* UNINSTALLATION
##*===============================================
[string]$installPhase = 'Uninstallation'
## Handle Zero-Config MSI Uninstallations
If ($useDefaultMsi) {
[hashtable]$ExecuteDefaultMSISplat = @{ Action = 'Uninstall'; Path = $defaultMsiFile }; If ($defaultMstFile) { $ExecuteDefaultMSISplat.Add('Transform', $defaultMstFile) }
Execute-MSI @ExecuteDefaultMSISplat
}
# <Perform Uninstallation tasks here>
##*===============================================
##* POST-UNINSTALLATION
##*===============================================
[string]$installPhase = 'Post-Uninstallation'
## <Perform Post-Uninstallation tasks here>
}
##*===============================================
##* END SCRIPT BODY
##*===============================================
## Call the Exit-Script function to perform final cleanup operations
Exit-Script -ExitCode $mainExitCode
}
Catch {
[int32]$mainExitCode = 60001
[string]$mainErrorMessage = "$(Resolve-Error)"
Write-Log -Message $mainErrorMessage -Severity 3 -Source $deployAppScriptFriendlyName
Show-DialogBox -Text $mainErrorMessage -Icon 'Stop'
Exit-Script -ExitCode $mainExitCode
}