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,459
  • 12
  • 26
  • 43
acgbox
  • 741
  • 2
  • 13
  • 31
  • Without an English translation of the log very few members of this community know enough about Windows to answer this question. The generated log file specified in the error dialogue contains the reason the command failed – Ramhound Sep 10 '20 at 00:17
  • The fault log may change. It is just an example. That is why it is irrelevant to my question. What I'm looking for is someone to tell me what is the safest method to do this job, that does not generate crashes or compromise essential functions or applications of Windows 10. – acgbox Sep 10 '20 at 14:25

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
  • 741
  • 2
  • 13
  • 31