Thanks in advance for all your help

My computer shuts off at random times. This happens mostly when I'm playing a game of some sort (it's shut off when I'm on my desktop a few times too). It does not shut off everytime I play a game, I would say that now the frequency is sporadic. It used to happen on a more frequent basis, but following the good advice of a staff member here, I removed a recent Microsoft security update and it's been shutting off a lot less.
At first I suspected that it was time to replace my power supply, but I noticed that before my computer shuts off, it actually quits out of my game first. That makes me suspect it is a software issue. This has happened over a few different games, so it's not any one game in particular.
Any ideas? I don't even know where to begin to look. I don't want to buy a new power supply for the heck of it.
Thanks!