Powershell Editor

About | @adamdriscoll

  • Visual Studio 2017 (15.8+) or 2019
  • Visual Studio Community, Professional and Enterprise
  • PowerShell v5 or later
  • .NET 4.7.2

PowerShell studio provides many features and advanced level of functionalities. This tool is paid software and it costs around $399.00. Below features that are supported by PowerShell Studio. Fully featured PowerShell Editor. Visually create the PowerShell GUI tool. Convert script into executable (.exe) files. Create MSI installers. PowerShell editors Posted on Saturday 30 September 2017 by richardsiddaway PowerShell works great when you use it interactive;y but at some point you’re likely to want to write substantial pieces of code – scripts or functions – for which you’ll need an editor.

PowerShell Tools for Visual Studio brings the richness of the Visual Studio development experience together with the power of PowerShell. Using this extension you can:

IntelliSense

PowerShell Tools provides IntelliSense for cmdlets, parameters, .NET classes, variables and paths.

Editor

Debugging

Set breakpoints and step through PowerShell scripts with the Visual Studio debugger. View local variables, call stack and set watch variables.

Project System

Organize scripts in a Visual Studio project that can generate manifests and package scripts as executables.

Interactive Console

The PowerShell Interactive Window provides an interactive console experience that supports IntelliSense.

Pester Test Adapter

Powershell

The Pester Test adapter displays tests and allows you to run them from the Test Explorer window.

PowerShell Pro Tools provides additional features for PowerShell pros.

PowerShell 6 and 7 Support

Execute scripts in PowerShell 6 and 7 within Visual Studio.

Static Script Analysis

PSScriptAnalyzer support provides inline recommendations and quick fixes.

Windows Forms Designer

The PowerShell Windows Forms designer generates PowerShell script with the built-in, drag and drop forms designer.

WPF Designer

The WPF Designer generates event handlers and XAML loading methods automatically.

PowerShell Script Packaging

The PowerShell script packaging system compiles PowerShell scripts to executables with a large set of options.

Variables Tool Window

The variables tool window provides access to variables even when you aren't in the debugger.

Modules Tool Window

The modules tool window displays modules loaded into the current session and available on the system.

For more information or to purchase a license, visit IronmanSoftware.com.

If you are familiar with Linux or come from a Unix background, you probably know about Vim. For those of us that started and stay mostly in the realm of Windows however; Vim may be a foreign thing. I was fortunte enough to be exposed to vim, and see what it can do; now there's no turning back.

Vi on the Command Line

There has been a module for PowerShell for a while now that allows you to use a vi editor on the command line. Previously you would have had to copy the code from GitHub, but now - thanks to the PowerShell NuGet package manager - you can install it easily straight from PowerShell. Better yet, if you are on Windows 10, or server2016, it comes pre-installed.

You can check if you have it with one command.

If you don't get any results then it's not installed.

Powershell

If you have a version number 1.1 or prior, then you will need to upgrade the version to 1.2 or higher:

You can install it like so:

If you haven't setup NuGet previously, you can follow the onscreen instructions to get it setup and configured.

Now that you have it, you can setup your command line editor in vi mode:

If you want this set by default you can add this to your profile so it loads automatically.

If you don’t have it

If you are on anything before win10 or server 2016, you will need to some prep work:

  • You need to have .Net 4.5 installed.
    • Download here
  • Minimum Windows Management Framework version 3 (WMF 3), but I recommend WMF 5.1.
    • WMF3, WMF5.1
  • You need the PackageManagement PowerShell module
    • Download here
Powershell Editor

With these prerequisites installed, you can follow the steps above to install PSReadline.

Vim on Windows

Now that you have your command line setup with vi, now you can setup the real thing.You can download Vim for Windows here, orwith code (working at the time of writing this post):

This is a self installing exe, so all you need to do is run it and customize it as you will. I typically just use the default settings (next, next, finish).

Powershell Editor Vim

Configure Vim for PowerShell

By default, vim is installed here 'C:Program Files (x86)Vim'. The executable that you will want to run will be here: 'C:Program Files (x86)Vimvim80vim.exe'. You can add the base path of the above to your PATH, but since I will only be using the one executable here (vim.exe), and I will only be using it via PowerShell, I simply create an alias in my PowerShell profile.

Now next time you want to edit a file, instead of notepad '.test.txt', do vi test.txt.

Customize your vimrc file

Powershell Editor For Mac

There should be a a file named '_vimrc' in your user directory. If there isn't you can go ahead and create it.

Now I'm still relatively new with using Vim, but these are the settings that I have come accross that work well for me with PowerShell. The biggest problem for me was finding a color scheme that worked with PowerShell's color scheme.

This is a start; hopefully you can build on this and improve on it.

SIDE NOTE:If you want to write PowerShell code using Vim, I would recommend using VisualStudio Code.If has extensions for both PowerShell and Vim.The PowerShell extension allows for ‘Intellisense’ and syntax highlighting for PowerShell;and the Vim extension will allow you to use Vim shortcuts for editting your code.


Thanks for reading

PS> exit