It depends on how far in the startup sequence your machine is getting.
A bad power supply won't even let your processor start up.
A bad hard drive will give you an error message.
A bad mother board may or may not give you a message.
Unseated ram will give you a message.
Laptops may have defunct batteries but should still work with charger.
There's so many ifs ands or buts with computers it's ridiculous. And even the term "bad" has a lot of meanings from items simply needed to be re-connected, fried, damaged, cracker, reinstalled, reseated, cleaned, etc.
The current rig I'm using had a DOA power supply and it took me an hour or so to troubleshoot all my parts. My fans and LED lights were turning on for a second and then shutting off. Wasn't sure if it was the MB or power supply. Started going backwards. Took the ram out. Tried it. Took the HD out. Tried it. Took the GFX out. Tried it. Reseated the processor. Tried it. Tried all the cabling, uncabling, and recabling. Picked up a power supply at Best Buy tried it. Success.