Open daviwil opened 8 years ago
I'd love to be able to start writing against $PSEditor but figuring out how to get PSES installed has been a pain.
Hey Nicholas, you don't really need to set up PSES to get started using the $psEditor
API, you can actually do it using the version of PSES that comes with the PowerShell extension for VS Code. If you open up a .ps1 file in the editor you can write some code against $psEditor
, select it, and press F8 to evaluate it in the session. You can even register commands with Register-EditorCommand
by using F8. Let me know if you have any trouble with this!
Not sure what I was doing wrong but $psEditor showed nothing and Register-EditorCommand came back with "not recognized as the name of a cmdlet...".
Works now.
Maybe you were running the script in the debugger? Currently the $psEditor
stuff isn't loaded when scripts are being executed in the debugger.
That's it. I'm used to the ISE where there is really only one output pane.
I think we'll be back to that style of development soon!
@daviwil Is this work relevant anymore since PSES ships along with the extension so that people can install the extension on locked down environments?
Not exactly as relevant as it was previously. My plan for the upcoming ide-powershell extension in Atom is to download PSES releases dynamically without shipping a bundled PSES, but I haven't decided how I want to do that yet. I think it could be nice to include some default behavior in Start-EditorServices.ps1 which can be used across any editor that leverages PSES (Vim is another example if you guys ever ship Kapil's Vim-PowerShell extension).
I'd say leave this issue open for now, I may take a stab at it pretty soon.
The Start-EditorServices.ps1 script is meant to have behavior to check whether the PSES module is installed on the user's machine and provide feedback to the editor so that they can prompt the user to accept its installation. The installation step should also be provided by the bootstrapper script.
This work needs to be finished to enable extensions for Sublime Text and other editors to invoke the installation of the PSES module without having to bundle it with their distributions.