0

I am making a windows 10 May 2020 image of a PC with sysprep. But it stops with an error.

enter image description here

To fix it I run the following PowerShell commands:

Import-Module appx
Import-Module dism
Get-AppxPackage | Remove-AppxPackage

enter image description here enter image description here

And sysprep runs fine, finishes image:

enter image description here

And when starting everything works as it should, except Windows Security, which starts but does not allow access to the configuration panel, nor does it allow restarting it in "services". I cannot determine the cause of the problem, but sfc/scannow does not fix these problems.

Anyway, what I really want to know is the safest way to do this job, so it doesn't affect any essential Windows 10 apps.

PD: Here's how to exclude an app, but I don't know which packages should be excluded so it doesn't affect essential apps. Example:

Get-AppxPackage | where-object {$_.name –notlike "*store*"} | Remove-AppxPackage
ZygD
  • 2,577
acgbox
  • 844

1 Answers1

0

Since no one published a "safe method", then there is this workaround, which still solves the problem. For fix windows security center, just re-register app. Run Windows PowerShell (admin):

Add-AppxPackage -Register -DisableDevelopmentMode "C:\Windows\SystemApps\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy\AppXManifest.xml"

For re-register all apps:

Get-AppXPackage -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$ ($ _. InstallLocation) \ AppXManifest.xml"}
acgbox
  • 844