Injunction

Noun : An authoritative warning

Sentence #1

Because he had witnessed the murder, the man received an injunction to testify in court.

Sentence #2

The king issues an injunction that no one should wander the streets after curfew.