Skip to content

digitalguy99/pwsh-syntax-highlighting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pwsh-syntax-highlighting

This project is inspired by the zsh-syntax-highlighting project.

Requirement: pwsh 5.1+

This package provides syntax highlighting for PowerShell. It enables highlighting of commands whilst they are typed at a PowerShell prompt into an interactive terminal. This helps in reviewing commands before running them, particularly in catching syntax errors.

Preview

demo.mp4

How to install

  1. Run PowerShell as Administrator.

  2. Execute the following command:

    Install-Module syntax-highlighting
  3. Run the following and restart PowerShell:

    echo "Import-Module syntax-highlighting" >> $profile

    so you don't have to import the module every time you open PowerShell.

Limitations

  • Commands after a semicolon and second line commands will not be validated
  • Only works with Windows and doesn't work on macOS/Linux
  • Doesn't validate commands that begin with a "#" well

Credits


Rajeswar Khan