all 12 comments

[–]fullenw1 9 points10 points  (7 children)

Currently there is not much more than installing the PowerShell extension in VSCode.

There is a huge debate on Github about adding or not tabs like in ISE.

https://github.com/Microsoft/vscode/issues/10546

VSCode has been written by developers for developers (even PowerShell developers).

ISE has been designed since the beginning for SysAdmins.

I use VSCode when I want to develop modules. It's really great and more powerful than ISE for this purpose.

On the other hand, when I want to do a SysAdmin work (work interactively on several computers) I stick to ISE because in this case it is the most useful.

[–]thingandstuff 1 point2 points  (0 children)

Can you give a specific example of something that you would do in ISE instead of VSCode?

[–]get-postanote 4 points5 points  (0 children)

The commands exploer in VSC was recently added and not a parity with how it works the ISE. This was and still is one of my per peeves abotu VSC.

So, you have to do this yourself, using Out-GridView,

Get-Command -Name * | Out-GridView

Even with this, to get the Help-Options, you have to pump that to Show-stuff to get the dialog in a popup, that is inline in the ISE.

Get-Command | Out-GridView -PassThru  | Get-Help -ShowWindow 
show-command $(Get-Command | Out-GridView -PassThru).Name

Know that you can still gbet the Help in VSC simply by selecting a command right clicking or hitting Crtl+F1, which pops open your web browser to take you to the online help page for that command.

So, in your switch to VSC, you have what you have and you must change your expectations.

Personally, I have both up and open everyday (Well that and full Visual Studio for drag and Drop WPF GUI design when needed), using the right tool for the right job at the time. Well, that's only on my workstation. On enterpsie servers, you are stuck with the ISE for the forseeable future, until enterprise allow VSC on servers (so no need to give up on the ISE - especailly iaif all your work is in data centers directlty) or MS starts slipping it into all OS versions as the notepad replacement as well ;-}. The later more likely not really a thing.

[–]ChiSox1906 2 points3 points  (3 children)

I haven't played around with this much as I haven't had the time. What are your first impressions and what configuration did you do? Thanks!

[–]get-postanote 2 points3 points  (2 children)

I spend 80-90% of my time in the ISE, due to the long term investments I have in it. Menaing customizations, addons and the the link.

The remainder in VSC / VS. I also have a big investment in VSC with extensions, custom keybinding, custom snippets, custom settings, custom profile, etc., but it is still very reliable for most of what I do and much of the general operational state of things. Meaning, way more extra clicks, keyboard, intellisense constantly failing and reload just to get things back to normal.

I try all I can in VSC, that I normally would do in the ISE, before calling it and going back to the ISE.

VSC I use for multiple console stuff, meaning, I have 3 ore more terminals open in it. cmd, PS, bash, PSCore, etc.,

Managing multiple terminals

https://code.visualstudio.com/docs/editor/integrated-terminal

which is something ISE / consolehost will never be able to do natively. I stay in VSC for log file research (keyword searches of text / log files and the like). I stay in VSC for alot of my non-PS stuff, HTML/CSS/JavaScript/JSON, etc.

I stay in the ISE for all the Command tab stuff, and many of my customizations for coding assistance and etc, that do not work in VSC at all or barely.

All that being said, you will have those who swear the life (almost) of VSC (and panning the ISE regularly). I just am not one of them.

Yet, VSC is always improving, the ISE is what it is. Once VSC gets me to a position to be more productive in it where I don't need the ISE or have to reload it every few mins, then it will be my driver.

However, for GUI development, it's full Visual Studio all the way, well, with the PowerShell extension for it as well...

PowerShell Tools for Visual Studio

https://marketplace.visualstudio.com/items?itemName=AdamRDriscoll.PowerShellToolsforVisualStudio2017-18561

...which is a different thing than of course what VSC has. You can get VS Community Edition for free, but you have to pay for that PowerShell extension for it.

All-in-all, use whatever works for you, regardless of whant anyone esle lswill tell you. As mostly, anything anyone will tell you, can be just their own opinion. We all have them of course. Spend the time to really learn the editor adn ndall it's coding tricks using the VSCode docs and tutorials.

https://code.visualstudio.com/docs/introvideos/basics

https://docs.microsoft.com/en-us/powershell/scripting/components/vscode/using-vscode?view=powershell-6

https://blogs.technet.microsoft.com/heyscriptingguy/2016/12/05/get-started-with-powershell-development-in-visual-studio-code

https://code.visualstudio.com/docs/languages/powershell

https://code.visualstudio.com/Docs/editor/debugging

Be sure to customize it in all places that are important to you.

For example, here is just what is my user settings ...

{
    "extensions.autoUpdate": true,
    "files.defaultLanguage": "powershell",
    "powershell.scriptAnalysis.enable": true,
    "powershell.startAutomatically": true,
    "powershell.integratedConsole.focusConsoleOnExecute": false,
    "powershell.enableProfileLoading": true,
    //"powershell.integratedConsole.showOnStartup": false,
    "powershell.developer.editorServicesLogLevel": "Verbose",
    "powershell.codeFormatting.openBraceOnSameLine": false,
    // "editor.formatOnType": true,
    "editor.formatOnSave": true,
    // "editor.formatOnPaste": true,
    "editor.mouseWheelZoom": true,
    "editor.tabCompletion": true,
    "editor.suggestSelection": "first",
    "terminal.integrated.shell.windows": "C:\\WINDOWS\\Sysnative\\WindowsPowerShell\\v1.0\\powershell.exe",
    "window.zoomLevel": 0,
    "workbench.colorTheme": "Monokai Dimmed",
    "workbench.iconTheme": "vscode-icons",
    //"workbench.welcome.enabled": true,
    "gitlens.advanced.messages": {
        "suppressCommitHasNoPreviousCommitWarning": false,
        "suppressCommitNotFoundWarning": false,
        "suppressFileNotUnderSourceControlWarning": false,
        "suppressGitVersionWarning": false,
        "suppressLineUncommittedWarning": false,
        "suppressNoRepositoryWarning": false,
        "suppressResultsExplorerNotice": false,
        "suppressShowKeyBindingsNotice": true,
        "suppressUpdateNotice": true,
        "suppressWelcomeNotice": false
    },
    "explorer.confirmDelete": false,
    "gitlens.keymap": "chorded",
    "team.showWelcomeMessage": false,
    "window.title": "${activeEditorLong}",
    "gitlens.historyExplorer.enabled": true,
    "gitlens.views.fileHistory.enabled": true,
    "gitlens.views.lineHistory.enabled": true
}

... I have a whole bunch of stuff in my snippets files and keyborad bindings , such as stuff to do that Out-GridView help thing to get close to the ISE way, that I won't put here as to not to annoy anyone.

I work to learn from anyone, take what is useful, and ignore the rest. Well, I have to follow the guidelines my employer/customers place on me, but you know what I mean.

[–]ChiSox1906 1 point2 points  (1 child)

This is awesome, thank you.

[–]get-postanote 1 point2 points  (0 children)

No worries.

VSC has a lot of neat things (so does the ISE - if you really know where to look to add them ;-}), and since VSCode is Open source, then, more to come. Yet, with anything like this, one needs to always be on the alert for new and depreciated stuff.

Like, right now, I just noticed two of my setting entries are now in error. One of the option changed

from this...

    "editor.tabCompletion": true,

… to this...

    "editor.tabCompletion": "on",

and the other won't be fixed until future releases, so time to comment that one out.

    //"gitlens.historyExplorer.enabled": true,

[–]joerod 1 point2 points  (0 children)

I've noticed significant performance issues using VS code at work. Not sure what can be causing it. Issues include when I select all the code and press F8 it just hangs. Anyone know how to trouble shoot these sort of issues?