Advertisement

Add Edit with PowerShell ISE as Administrator Context Menu

PowerShell is an advanced form of command prompt. It is extended with a huge set of ready-to-use cmdlets and comes with the ability to use .NET framework/C# in various scenarios. Windows includes a GUI tool, PowerShell ISE, which allows editing and debugging scripts in a useful way. If you are using it frequently, you might find it useful to add 'Edit with PowerShell ISE as Administrator' to the context menu.

Advertisеment

From the official documentation:

The Windows PowerShell Integrated Scripting Environment (ISE) is a host application for Windows PowerShell. In Windows PowerShell ISE, you can run commands and write, test, and debug scripts in a single Windows-based graphic user interface with multiline editing, tab completion, syntax coloring, selective execution, context-sensitive help, and support for right-to-left languages. You can use menu items and keyboard shortcuts to perform many of the same tasks that you would perform in the Windows PowerShell console. For example, when you debug a script in the Windows PowerShell ISE, to set a line breakpoint in a script, right-click the line of code, and then click Toggle Breakpoint.

Try these features in Windows PowerShell ISE.

  • Multiline editing: To insert a blank line under the current line in the Command pane, press SHIFT+ENTER.
  • Selective execution: To run part of a script, select the text you want to run, and then click the Run Script button. Or, press F5.
  • Context-sensitive help: TypeInvoke-Item, and then press F1. The Help file opens to the Help topic for the Invoke-Item cmdlet.

The Windows PowerShell ISE lets you customize some aspects of its appearance. It also has its own Windows PowerShell profile, where you can store functions, aliases, variables, and commands you use in the Windows PowerShell ISE.

Windows 10 PowerShell ISE

By using the Registry files provided below, you will be able to integrate the elevated PowerShell ISE (both 64-bit and 32-bit) with the File Exporer context menu in Windows 10.

Windows 10 PowerShell ISE Context Menu

Add Edit with PowerShell ISE as Administrator Context Menu in Windows 10, do the following.

  1. Download the following Registry files in the zip archive: Download Registry Files.
  2. Extract them to any folder you like. You can place them right on the Desktop.
  3. Unblock the *.REG files.
  4. Double click the "Add Edit with PowerShell ISE as Administrator.reg" file.
  5. If you are running a 64-bit Windows 10 version, you might want to add the command "Add Edit with PowerShell ISE x86 as Administrator.reg" if you need the 32-bit PowerShell ISE version frequently.

The commands are now available from the context menu of your PS1 files.

The registry files above will add a new entry to the Registry under the key

HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\

The entry will launch the main executable file of PowerShell ISE (powershell_ise.exe) using the trick described in the article Start a Process Elevated from PowerShell. This will open PowerShell ISE as administrator for the selected PS1 scripts.

The undo tweak is included.

That's it.

Articles of interest:

Support us

Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:

If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!

Advertisеment

Author: Sergey Tkachenko

Sergey Tkachenko is a software developer who started Winaero back in 2011. On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. Follow him on Telegram, Twitter, and YouTube.

Leave a Reply

Your email address will not be published.

css.php
Using Telegram? Subscribe to the blog channel!
Hello. Add your message here.