All private investigators in Texas must be licensed.
Attorneys won't use unlicensed pi's since the attorney can be charged with a Class A Misdemeanor.
Attorneys are also scared to encourage a client to engage in conduct that the lawyer knows to criminal or fraudulent or from using any method of obtaining evidence that violates the legal rights of a 3rd party.
Attorneys also warn their own clients against being a "detective" since the client might violate federal and/or state laws.
An example would be putting a tracking device or spyware on property that you do not clearly own. So if your name is on a vehicle it's probably ok to put a tracking device on it. But if the vehicle is not in your name it's clearly illegal to do so -- even if it's your spouse's vehicle.
Do not set up fake social media profiles in an attempt to gather information on your spouse or anyone.
Do not harass anyone -- even using social media.
Do not intercept text messages/emails from another person's phone or computer.
Be aware that if you hire a pi that all information gathered is discovered in a family law case. You might not want the other side to be aware of everything the pi gathers.
PIs cannot go onto private property. They must remain on public property. They can however go through a person's trash once it is put at the street for trash pick-up.