there's an even easier way to restart your computer using just the keyboard. Simply press and hold Control + Command + Power/Eject/Touch ID button on your keyboard until your Mac restarts.
not as flexible as the Restart-Computer cmdlet. An additional prerequisite for the command to work is, ensure that WinRM is configured and allowed through the remote computer’s Windows firewall.
It might take about 15-20 minutes for the scan to fix corrupted system files, so let the command finish successfully. Once done, restart your PC and then launch Command Prompt. Hopefully ...