In the Series 6 episode "Day of the Moon", the Doctor turns the Silents' own ability against them by splicing the moon landing broadcast with a clip of a Silent saying "you should kill us all on sight." This implants all of the humans that are watching the broadcast with a post-hypnotic suggestion to try to kill any Silent they see. However, the Doctor, Rory, Amy, and River are all present when the Doctor does this, and are also surrounded by Silents. However, even though they see the clip, they are perfectly capable of running away from the Silents and show no compulsion to kill them. The Doctor in particular should have started killing the Silents even earlier, as Canton sent him the clip of the Silent, which the Doctor then watched for himself so that he could see what it was. This is essentially the same thing that the Doctor did to humanity (watched an out-of-context clip of a Silent suggesting that they all be killed on sight), so wasn't he affected?
The Doctor is at least mildly psychic, and the TARDIS far more so.
My guess is that Amy and Rory, being at least somewhat prepared for the video, were able to overcome it. The TARDIS, which is tied into their brains (and provides them the ability to speak & understand any language they've encountered) likely aided in this.
The Doctor, having complete foreknowledge of the plan, would have been resistant to the post-hypnotic suggestion in any case. Couple that with his experience, training, ability, and general dislike of ending lives, and it's easy to see how he would avoid the murderous impulses.
In addition to Jeff's very good answer, I would like to posit that the post-hypnotic suggestion ability of the Silents has some limits.
Frequently in the portrayal of hypnosis and hypnotic control, the effect breaks if it would cause harm to the hypnotized party. In fact, this point is explicitly made by the Doctor in the Christmas Invasion:
It's like hypnotism. You can hypnotise someone to walk like a chicken or sing like Elvis, you can't hypnotise them to death - survival instinct's too strong.
If we take this at face value, we can assume that when attempting to kill the Silents would be extremely dangerous, the post-hypnotic suggestion would be overruled by survival instincts.
So, even if they are not immune to the effects thanks to some telepathic spacey-wacey stuff, and even if having explicit knowledge of the fact they were receiving a post-hypnotic suggestion they should ignore as they received it did not protect them from it, then certainly in a situation where they are surrounded and outnumbered by angry and deadly Silents should have enough instinct for survival to run rather than die in a pointless attempt to kill some of the Silents.
It is questionable whether or not The Doctor and his companions would be immune to the effects of a command they fabricated. We see them all being perfectly vulnerable to the Silent's mind-tricks on other accounts.
However, for me the more important point is the phrasing of the message. It's not exactly a command or a hypnotic suggestion (which compels you to perform some action). It's phrased in the form of a regular suggestion or rather recommendation. The Silent says: "You should kill me [..]".
The Doctor doesn't kill. At least, he tries very hard to avoid it.
Except for River, who has a mind of her own, The Doctor's companions more or less follow the non-lethality rule (mostly because they don't have the means to kill aliens, granted --- but still). If receiving a recommendation, The Doctor would most of the time ignore it and decide all by himself. Especially, if the recommendation implies murder.
Observe, how this is a hidden criticism of humanities gullibility and viciousness --- a mere whisper suffices and we happily commit genocide and go right back to our everyday life without even giving it a second thought.
This makes sense both as a statement by The Doctor as well as by the writers. Showing the flaws (as well as some strengths) of humanity is a theme you encounter a lot in DW, so it is quite reasonable to interpret this as a similar instance of rubbing our noses in our weaknesses.