Title: Powershell Syntax Highlighting
Last modified: June 9, 2023

---

# Powershell Syntax Highlighting

 *  [texnic](https://wordpress.org/support/users/texnic/)
 * (@texnic)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/powershell-syntax-highlighting/)
 * Hi!
 * Can anyone tell me, how I can use my regex to highligh words?
 * For example:
 * New-NetFirewallRule -DisplayName “SQLServer Browser service” -Direction Inbound-
   LocalPort 1434 -Protocol UDP -Action Allow
 * I want to highligh “-DisplayName” “-Direction” and so on with my color. I can
   highligh these expressions whith Regex (\s-\w+)
 * I guess need to edit this file [https://github.com/EnlighterJS/EnlighterJS/blob/master/src/lang/powershell.js](https://github.com/EnlighterJS/EnlighterJS/blob/master/src/lang/powershell.js)
 * What I have to do for this?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Andi Dittrich](https://wordpress.org/support/users/andi-dittrich/)
 * (@andi-dittrich)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/powershell-syntax-highlighting/#post-16806910)
 * it’s the correct file. just add your custom regex rules and run the build script.
   finally replace the enlighterjs.min.js file and purge the cache
 *  Thread Starter [texnic](https://wordpress.org/support/users/texnic/)
 * (@texnic)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/powershell-syntax-highlighting/#post-16814191)
 * Thank you!
 *  Thread Starter [texnic](https://wordpress.org/support/users/texnic/)
 * (@texnic)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/powershell-syntax-highlighting/#post-16814399)
 * Oh, one more question, please.
 * How I can highligh words like Inbond and Allow?
 *  Plugin Author [Andi Dittrich](https://wordpress.org/support/users/andi-dittrich/)
 * (@andi-dittrich)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/powershell-syntax-highlighting/#post-16814432)
 * same file, copy the keyword regex or customize it

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Powershell Syntax Highlighting’ is closed to new replies.

 * ![](https://ps.w.org/enlighter/assets/icon-256x256.png?rev=1215872)
 * [Enlighter - Customizable Syntax Highlighter](https://wordpress.org/plugins/enlighter/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/enlighter/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/enlighter/)
 * [Active Topics](https://wordpress.org/support/plugin/enlighter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/enlighter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/enlighter/reviews/)

## Tags

 * [powershell](https://wordpress.org/support/topic-tag/powershell/)

 * 4 replies
 * 2 participants
 * Last reply from: [Andi Dittrich](https://wordpress.org/support/users/andi-dittrich/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/powershell-syntax-highlighting/#post-16814432)
 * Status: not resolved