Removing Windows 8.1 Built-in Applications

Last year I published a PowerShell script that is designed to remove the built-in Windows 8 applications when creating a Windows 8 image. Well now that Windows 8.1 has been released we must update the PowerShell script to work with Windows 8.1.

The script below takes a simple list of Apps and then removes the provisioned package and the package that is installed for the Administrator. To adjust the script for your requirements simply update the $AppList comma separated list to include the Apps you want to remove. The script is designed to work as part of an MDT or Configuration Manager task sequence. If it detects that you are running the script within a task sequence it will log the to the task sequence folder otherwise it will log to the Windows\temp folder.

<#    
    ************************************************************************************************************
    Purpose:    Remove built in apps specified in list
    Pre-Reqs:    Windows 8.1
    ************************************************************************************************************
#>

#---------------------------------------------------------------------------------------------------------------
# Main Routine
#---------------------------------------------------------------------------------------------------------------

# Get log path. Will log to Task Sequence log folder if the script is running in a Task Sequence
# Otherwise log to \windows\temp

try

{

$tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment

$logPath = $tsenv.Value("LogPath")

}

catch

{

Write-Host "This script is not running in a task sequence"

$logPath = $env:windir + "\temp"

}

$logFile = "$logPath\$($myInvocation.MyCommand).log"

# Start logging

Start-Transcript $logFile

Write-Host "Logging to $logFile"

# List of Applications that will be removed

$AppsList = "microsoft.windowscommunicationsapps","Microsoft.BingFinance","Microsoft.BingMaps",`

"Microsoft.BingWeather","Microsoft.ZuneVideo","Microsoft.ZuneMusic","Microsoft.Media.PlayReadyClient.2",`

"Microsoft.XboxLIVEGames","Microsoft.HelpAndTips","Microsoft.BingSports",`

"Microsoft.BingNews","Microsoft.BingFoodAndDrink","Microsoft.BingTravel","Microsoft.WindowsReadingList",`

"Microsoft.BingHealthAndFitness","Microsoft.WindowsAlarms","Microsoft.Reader","Microsoft.WindowsCalculator",`

"Microsoft.WindowsScan","Microsoft.WindowsSoundRecorder","Microsoft.SkypeApp"

ForEach ($App in $AppsList)

{

$Packages = Get-AppxPackage | Where-Object {$_.Name -eq $App}

if ($Packages -ne $null)

{

      Write-Host "Removing Appx Package: $App"

      foreach ($Package in $Packages)

      {

      Remove-AppxPackage -package $Package.PackageFullName

      }

}

else

{

      Write-Host "Unable to find package: $App"

}

$ProvisionedPackage = Get-AppxProvisionedPackage -online | Where-Object {$_.displayName -eq $App}

if ($ProvisionedPackage -ne $null)

{

      Write-Host "Removing Appx Provisioned Package: $App"

      remove-AppxProvisionedPackage -online -packagename $ProvisionedPackage.PackageName

}

else

{

      Write-Host "Unable to find provisioned package: $App"

}

}

# Stop logging

Stop-Transcript

When removing applications from Windows 8.1 it is important that you also create and deploy a custom start screen layout using the  export-layout PowerShell command. See my previous blog on how to customize the start screen for more guidance - http://blogs.technet.com/b/deploymentguys/archive/2012/10/26/start-screen-customization-with-mdt-.aspx?pi36647=2.

For more information on adding and removing apps please refer to this TechNet article.

This post was contributed by Ben Hunter , a Senior Product Marketing Manager with Microsoft

Disclaimer: The information on this site is provided "AS IS" with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of included script samples are subject to the terms specified in the Terms of Use .