While anything is possible, the most common damage that occurs from an unexpected power loss to a computer is data corruption. Checking for hardware damage can be difficult and it may not be conclusive (intermittent) or even show up for some time. But usually, if there’s no immediate problems, then you can assume that it’s okay physically, especially if the sudden shut down was merely due to a power loss as opposed to a power spike. You should however make sure that your files are okay. You can replace hardware and reinstall Windows, but the files you create are irreplaceable, so if there is corruption, the faster you detect it, the better the chances of recovery (especially if you keep backups).
Technical
When a complex OS like Windows is running, there are all kinds of open files. To increase performance, the OS does not always write everything to the disk the moment the write command is issued and buffers them so that they can be written in batches. This makes the system more responsive by cutting down on disk accesses.
Because of the fact that files are left open and writes are buffered, if the system loses power unexpectedly, there may have been data that was still in memory and not yet written to the disk, and therefore you could lose some data. For example, you may have had a file open in an editor, and even if you did clicks save, it may not have been written to the disk yet and been in cache, so when you power back up, you find that the changes are gone (or the whole file is empty/corrupt if you had never saved yet).
Worse, because of how file-systems work and how OSes manage files, sometimes things can get corrupted. The OS may have been in the middle of a file-system operation like moving a file, deleting a file, or updating the file-system when the power went out. In this case, the file-system can be in an indeterminate state and files could have been messed up and making new changes to the disk (like simply booting up), could end up corrupting files or causing them to be lost altogether.
Auto-Repair
Your best bet to check for damage after an unexpected power loss is to scan the file-system for corruption. What normally happens is that Windows writes a flag to the disk to let it know that the file-system is active, and clears the flag when it is not (e.g., when it shuts down). If the power suddenly goes out, the next time that Windows boots, it detects that the flag is set and thus the file-system may be corrupt. In that case, it automatically runs a scan of the disk during its pre-boot phase (before Windows actually loads, and therefore no other file activity takes place that could corrupt the disk).
Unfortunately, Windows’ automatic scan does not always trigger, so whenever you have an unexpected shut down like that, it’s always a good idea to boot up in safe-mode first (so that no programs or anything run and make changes to the disk), and run a scan yourself.
Advice
You can scan your disk by right-clicking the drive in My Computer, selecting Properties, then clicking the Check Now button in the Tools tab. You can also open a command-prompt (Run ⇨ cmd
) and run the chkdsk
command to see the technical details of the scan.