If you are trying to repair your Windows image, copy and paste this exact line into an Admin Command Prompt DISM /Online /Cleanup-Image /RestoreHealth C:\Windows\Logs\DISM\dism.log to see the specific point of failure? How to Fix DISM Error 87 in Windows 11, 10 and 7 - SysTools
If that works, the problem is likely in your longer command’s syntax, not DISM itself.
Once you’ve fixed error 87, follow these best practices:
Where :1 is the image index (usually 1 for Home, 2 for Pro, etc.).