Has anyone found a plugin for Visual Studio to allow for PowerShell syntax highlighting or IntelliSense? If not, does anyone have any idea why not? I keep hoping someone else with copious free time would have tackled this by now. I have hope since other folks have managed to take the limited documentation and build custom IntelliSense providers for other languages such as NHaml.
Edit: To clarify,I'm not looking for a list of IDEs that can be used to develop PowerShell . I spend 90% of my day in Visual Studio. It already does a really good job of slicing and dicing code. That is the IDE I prefer to use to edit all text and code. The lack of PowerShell syntax highlighting now that I work with PowerShell scripts is down right painful.
In Quick Open, type ext install powershell and press Enter. The Extensions view opens on the Side Bar. Select the PowerShell extension from Microsoft. Click the Install button on the PowerShell extension from Microsoft.
The integrated environment is the only configuration that runs within Visual Studio. All other configurations run in external PowerShell processes. You can open the interactive window by pressing Ctrl+Shift+\ or by navigating to View \ PowerShell \ PowerShell Interactive Window.
PowerShell Extension Once you install the extension, you can create a new PowerShell script by pressing Ctrl+N and then saving it as a PS1 file using Ctrl+S . Once it is saved as a PS1, VS Code will identify the file as a PowerShell script. From there, you can execute the PowerShell script by press F5 .
Adam Driscoll has recently announced the PowerShell Tools for Visual Studio as successor of his former PowerGUI Visual Studio Extension - see his blog post about The Future of PowerGUI VSX for details, where he acknowledges the drawbacks of the predecessor outlined by Simon Gillbee (see previous update below) and describes how they will be addressed by removing the dependency on PowerGUI:
[...] By embedding the PowerGUI editor directly in Visual Studio it caused a multitude of problems because it really wasn’t a true language integration but more like a hack.
[...] PowerGUI VSX v2 will offer true Visual Studio language support for PowerShell. It uses the Visual Studio editor and the raw PowerShell debugger, tokenizer and completion engine. Currently, the requirement is PowerShell v3 and Visual Studio 2012. This requirement may change depending on community support and adoption. [emphasis mine]
Simon Gillbee has just referenced/promoted a PowerShell syntax highlighting alternative, that doesn't expose the drawbacks of the PowerGUI Visual Studio Extension he previously summarized:
The recently released PowerGUI Visual Studio Extension adds PowerShell IntelliSense support to Visual Studio. While it depends on the (free) PowerGUI graphical user interface and script editor, reusing this editor component should be a sign of maturity rather than an impediment I'd hope. (See Kirk Munros PowerShell support in Visual Studio! blog post for an introduction.)
Being a 1.0 there are still some minor issues with the extension as such, but Adam Driscoll seems to be pretty active tackling these - the PowerShell syntax highlighting and IntelliSense support is working most excellent for me already!
Here's a useful one: PowerGUI VS Extension.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With