Add Powershell to Windows Unattend to remove built-in Windows 10 apps

David Holland 1 Reputation point
2022-10-17T15:08:50.667+00:00

Hello,

I want to remove all of the built-in apps and shortcuts using the unattend file .. it drives me crazy that there shortcuts to Disney and Spotify, etc.

I am trying to use the following line in the Specialize pass under the Microsoft-Windows-Deployment section:

----------

*<RunSynchronousCommand wcm:action="add">  
                    <Description>Remove Built In Modern Apps</Description>  
                    <Order>4</Order>  
                    <Path>&quot;c:\windows\system32\windowspowershell\v1.0\powershell.exe&quot; -executionpolicy unrestricted -command &quot;Get-AppxPackage -allusers | Remove-AppxPackage&quot;</Path>  
  </RunSynchronousCommand>*  

----------

It gets to a point where it says "Windows could not parse or process unattend answer file [c:\windows\panther\unattend.xml] for pass [specialize].   The answer file is invalid.

It shows in Windows System Image Manager like this:

251181-image.png

If I need to call a .PS1 file to do this, that is okay, I was just hoping to keep it contained in a single line in the Unattend.

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,954 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.