Skip to content

Instantly share code, notes, and snippets.

@Krzysiu
Created February 16, 2026 21:09
Show Gist options
  • Select an option

  • Save Krzysiu/2d6610c2342b69b5133448aa5b1bdfcf to your computer and use it in GitHub Desktop.

Select an option

Save Krzysiu/2d6610c2342b69b5133448aa5b1bdfcf to your computer and use it in GitHub Desktop.

Adding "Run in Powershell ISE" command in Notepad++ context menu

Requirements

  1. Powershell ISE (probably you have it already in your Windows, if you want to use it. If not, search for instructions)

  2. Notepad++ (duh!)

  3. nppExec plugin (always worth having! You can install it via N++'s plugin manager or download it from GitHub repository))

Process

  1. Backup %APPDATA%\Notepad++\tabContextMenu.xml file

  2. Open NppExec console (F6 by default). Pase following code:

    NPP_CONSOLE 0
    cd $(CURRENT_DIRECTORY)
    npp_run $(SYS.WINDIR)\system32\WindowsPowerShell\v1.0\PowerShell_ISE.exe
    
  3. Click on the Save... button and give it some name (e.g. powershellrun)

  4. Go to plugins advanced options (Plugins->NppExec->Advanced options)

  5. Follow the screenshot instructions

    obraz
    1. Choose powershellrun from the list

    2. Set name powershell

    3. Click on the Add/modify

    4. Optionally (I recommend it!) set commands to appear in the Macro menu

    5. Save changes with OK

  6. Open Notepad++ tab menu file (%APPDATA%\Notepad++\tabContextMenu.xml)

  7. Add the following line: <Item PluginEntryName="NppExec" PluginCommandItemName="powershell" ItemNameAs="Open in PowerShell"/>(PEN must be like that, PCIN is the name from image 2nd point, INA is how it will look in the tab context menu) in the place where you find it most useful (of course in the <TabContextMenu> root)

  8. Restart Notepad++ and enjoy!

If something went wrong, check:

  1. If the script runs (F6, choose saved script, click OK - it should open PS ISS in the directory of currently open file)
  2. If it won't run, try changing the first line to NPP_CONSOLE 1. Run the script, observe if there are errors
  3. Try to run manually (win+R) %WINDIR%\system32\WindowsPowerShell\v1.0\PowerShell_ISE.exe. If it says the file is missing, use correct path in the script
  4. If script runs, but menu item doesn't appear check again if the name from ii (picture 2.) point is the same as PluginCommandItemName in the XML.
  5. Try adding ItemNameAs="foobar" to some existing menu item. Restart Notepad++. If you don't see "foobar" in list, it means Notepad++ loads default, hardcoded values, as it can't parse the XML file, so you probably deleted something important or pasted the line in the wrong place. Restore the backup (from the point 1), try adding it, this time without destroying structure.

If it still don't work, feel free to contact me. If you find it too difficult, I can record in OBS a whole process for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment