The new docs.trellix.com offers a modernized UI and AI-powered features like conversational searches. Content is currently available only in English. Other languages will be available in mid-October 2026. We hope you enjoy the new experience.

Block specific PowerShell parameters

Prev Next

This example rule prevents PowerShell from executing with specific command-line parameters, except for the encoded command, which is "dir c:\program files".

Note

Exploit Prevention is not supported in the ARM architecture.

Rule {
	Process { 
		Include OBJECT_NAME      { -v "*PowerShell*" }
		Include PROCESS_CMD_LINE { -v "*-NoLogo*" }
		Include PROCESS_CMD_LINE { -v "*-File*" }
		Include PROCESS_CMD_LINE { -v "*-EncodedCommand*" }
		Include PROCESS_CMD_LINE { -v "*-Command*" }
		Exclude PROCESS_CMD_LINE { -v "*-EncodedCommand
				ZABpAHIAIAAnAGMAOgBcAHAAcgBvAGcAcgBhAG0AIABmAGkAbABlAHMAJwAgAA==" }
	}
	Target {
		Match SECTION { Include -access "CREATE" }
	}
}

For more Expert Rules examples, visit the Trellix Github repository.