bateskevin / PSAtlas

PSAtlas, an interactive Powershell learning framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for other editors than Powershell ISE

bateskevin opened this issue · comments

Add support for more editors.

For VSCode support using the PowerShell extension, you could leverage:

Open-EditorFile (alias: psedit) to open files in the editor
New-EditorFile which lets you pass in a Path and Value which will create a new file at that Path with the Value contents.

@tylerl0706 thanks for the hint!

I think this will then be solved with a parameter "Editor" that let' you choose which one.

I do think that ISE should be the standart tho since it's preinstalled.

Maybe also a point for crossplattform support would be to determine on wbich os the function is exdcuted and according to that open the standard editor.

I think for now, that's fine. The ISE will be there for a while. Just some things to consider:

The ISE is in maintenance mode. Future work is being invested into the PowerShell extension for VSCode.

The ISE won't work with PowerShell Core 6

You might already know this stuff, if so, sorry to repeat, but in case you didn't that's the plan 😊

I'd love to figure out a way to help make the transition to vscode as easy as possible for our PowerShell ISE fans 😊

@tylerl0706 Yeah now when you say it, it actually does ring a bell that the ISE won't stay forever. I didn't think of that anymore. So thanks for bringing that up!

In this case it actually maybe the smarter.move to go ahead and use VSCode as the standard editor. I'll check that out tomorrow.

If you want to.take a look at it, the code is written very basic (but it's a little messy atm ;)). At the moment it's basically just the following call:

Ise -File $File 

I guess that'd be a change of 5 minutes, since the editor in which you edit the file has no dependencies whatsoever.

I think having VSCode as the standard then would actually make more sense then and adding the Editor parameter for now and deprecate it when ISE gets deprecated.

Awesome! If you run into any issues with the PowerShell extension for VSCode, I'm hear to help :) feel free to open an issue anytime! https://github.com/PowerShell/vscode-powershell

Thanks @tylerl0706 for the help in this Issue! I changed the code and updated the Docs. VSCode is now the primary editor in PWSHSchool.

You can however opt to Powershell ISE if you wish.

That's awesome! If you tweet about this, I would love to spread the word 😊

(also I'm going to give PWSHSchool a try when I get back from vacation!)

@tylerl0706 just tweeted it out. Thanks so much for your help! Would be awesome if you had the chancd to.check it out after your holidays. I hope you have a great time!

If I have a few moments I'll try to send you a PR with some stuff :)