Here is what I get in a Powershell (run as admin):
PS C:\Windows\system32> Dism.exe /online /Cleanup-Image /AnalyseComponentStore Deployment Image Servicing and Management tool Version: 10.0.15063.0 Image Version: 10.0.15063.0 Error: 87 The analysecomponentstore option is not recognized in this context. For more information, refer to the help. The DISM log file can be found at C:\Windows\Logs\DISM\dism.log
The error seems to be when the command is run on version of Windows other than 8 or 10. I have Windows 10 Pro, but I recently upgraded from Windows 7 Ultimate.
How can I solve this error?
Also when I run the command /StartComponentCleanup, I don't have any error.
PS C:\Windows\system32> dism /online /Cleanup-Image /StartComponentCleanup Deployment Image Servicing and Management tool Version: 10.0.15063.0 Image Version: 10.0.15063.0 [==========================100.0%==========================] The operation completed successfully.