Dear Sidra Rama
Judging from the current situation, CMD and PowerShell on your computer are missing components that have run as administrator, I suggest you try to create USB media to repair.
Running MediaCreationTool in safe mode seems to be an option, but my suggestion is to prepare an 8GB storage space USB and make a USB bootable drive on another computer. After the production is complete, insert it into the current system and boot from USB by modifying the BIOS/UEFI settings. At this point, you will enter an interface, as shown in the figure **(Repair your computer)**where you can complete the repair of the computer:
The following article may help you access to the interface of Repair your computer:
How to Perform a Clean Install or Reinstall of Windows 11 - Microsoft Community
Refer to the method here to set the boot from USB
Feel free to let me know how it goes.