Better yet, just let your dog out if you find someone in your yard.
Sure, if you have a big enough, well-trained enough dog to go for the throat of intruders only.
I’m all for shooting the bastards so they never bother another family, but people have to know their state’s laws and find a way to kill the intruder yet not end up in a jackpot.