Remove Built-in Apps in Offline media


I want to remove built-in apps during a offline media installation.

I tried 2 methods:
Command Line:
powershell.exe -command "Set-ExecutionPolicy Bypass"
Command line:
powershell.exe -file "%ScriptRoot%\Remove_BuiltinApps.ps1"
Start in:


Set Task Sequence Variable
cmd /c powershell.exe -ExecutionPolicy Bypass -Command

Run Powershell Script

Both methods are not working and the powershell feature is checked inside the properties.
Anyone an idea how to configure this inside MDT?

Microsoft Deployment Toolkit
Microsoft Deployment Toolkit
A collection of Microsoft tools and documentation for automating desktop and server deployment. Previously known as Microsoft Solution Accelerator for Business Desktop Deployment (BDD).
852 questions
Windows 10 Setup
Windows 10 Setup
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Setup: The procedures involved in preparing a software program or application to operate within a computer or mobile device.
1,919 questions
0 comments No comments
{count} votes

Accepted answer
  1. Simon Ren-MSFT 31,831 Reputation points Microsoft Vendor


    Thanks for posting in Microsoft MECM Q&A forum.

    1 It's recommended that we remove built-in apps firstly and then create a new OS image. We can remove a preinstalled app from a Windows image by using the DISM.exe tool or the DISM cmdlets in Windows PowerShell. For example:
    Dism /Image:c:\test\offline /Remove-ProvisionedAppxPackage /PackageName:microsoft.devx.appx.app1_1.0.0.0_neutral_en-us_ac4zc6fex2zjp
    For more detailed steps, please refer to:
    Remove a preinstalled app by using DISM

    2 We can also use customize PowerShell script to remove built-in apps (or default apps) in the reference images. For more detailed steps, please refer to the awesome blogs:
    Remove Built-in apps when creating a Windows 10 reference image
    Remove Built-in apps for Windows 10 version 1809

    Hope it helps. Thanks for your time.

    Best regards,

    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous

    Hi @Simon Ren-MSFT

    Thanks a lot again. I used the first url of option 2.
    I changed to location of the script in from offline to online (State Restore)