The new docs.trellix.com features a modernized UI and AI-powered conversational search. Content is currently available in English, with additional languages launching in early November 2026. We hope you enjoy the updated 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.