Community
    • Login

    PowerShell Language Woes

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    language
    6 Posts 4 Posters 12.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Marc CawoodM
      Marc Cawood
      last edited by

      I just want PowerShell syntax highlighting but it’s proving elusive.

      1. When I open .ps1 files no syntax is highlighted
      2. PowerShell is listed under “Language” -> “P” -> “PowerShell”
      3. When I click it from the Language menu nothing happens
      4. I had already created a User-Defined Language “PowerShell” which appears at the bottom of the Language Menu. Clicking this DOES highlight the syntax. But not when I open the file.
      5. Weirdly, Powershell is not listed in any language XML files I can find. So why is it in the Language -> P menu?
      Claudia FrankC 1 Reply Last reply Reply Quote 0
      • Claudia FrankC
        Claudia Frank @Marc Cawood
        last edited by

        @Marc-Cawood

        should be, at least, in langs.xml and langs.model.xml.
        If it isn’t - I would download your current npp as zip and replace
        the mentioned files with the downloaded ones. Just to test.
        Note, depending on your installation the langs.xml is either in
        the installation directory or under %APPDATA%\notepad++ directory.

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 0
        • Roman RevellR
          Roman Revell
          last edited by

          I have version 7.2.2. I have the same issue, no syntax highlighting. If I select Powershell from the P menu, it works. But, I notice there is also in the main Language menu, Powershell*. What does that mean and why does it do nothing when I select it?
          Powershell coloring really should be redone to match the Powershell ISE from Microsoft, which is better anyway. But, something would be nice. It worked fine until the last upgrade that I did to 7.2.2.

          Claudia FrankC 1 Reply Last reply Reply Quote 0
          • Claudia FrankC
            Claudia Frank @Roman Revell
            last edited by Claudia Frank

            @Roman-Revell

            if looks like this

            then the highlighted one is the builtin powershell lexer whereas the one under
            the separator line is a user-defined lexer (one you created manually).

            If it doesn’t work, than it must have been broken. Check via UDL gui or
            by inspecting the file userDefineLang.xml which is either under
            the %APPDATA% or under npp install directory.

            Cheers
            Claudia

            1 Reply Last reply Reply Quote 0
            • Roman RevellR
              Roman Revell
              last edited by

              Thank you. It looked the way I described it. But, it seemed to be working normally (and looks like your picture) on another machine. So, I tried uninstalling and then noticed there is version 7.3; so, I installed that and now it works on that machine too. Although, now there is just one long menu instead of the multi-tiered menu, which is fine.

              1 Reply Last reply Reply Quote 0
              • PeterJonesP
                PeterJones
                last edited by PeterJones

                @Roman-Revell,

                Although, now there is just one long menu instead of the multi-tiered menu, which is fine.

                Preferences > Language > Language Menu > ☑ Make language menu compact

                1 Reply Last reply Reply Quote 2
                • First post
                  Last post
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors