I have been using Powershell ISE for a long time and is very good software, it´s simple and not too much annoying stuff running in the background to be able to run the code you are writing. Microsoft has introduced Visual Studio Code which will also be available to write Powershell code, at the first start it was not specifically usable for powershell unless you would download extensions and it was not really simple at first sight, the next this was how to use Visual Studio Code and that was the same, so I had to search how to use it. In Powershell ISE you can just type in the code and enter F5 and you run the code and it is quick and easy but in Visual Studio Code is a different approach. The question is, should IT Admins prefer to use Visual Studio Code instead of Powershell ISE? Lets take a deeper look at Visual Studio Code and compare it. I´m going to use just a simple code that displays a variable, here is the code :
$HelloWorld = "Powershell Rocks!!!"
This code will just output the text in the variable when running. But what if I do the same in Visual Studio Code. The first thing you need to do is to save a new file to a PS1 file and Visual Studio Code will then popup with a information box and recommends Powershell development extension, you will need to install, enable and restart the application. After restart you need to open the PS1 file again and type in the code. But now when you click on F5 nothing happens, well that is seems that you cannot run just one file, you need to open a whole folder, well that is a problem because if I wanted to do a quick test script this would not be a whole big project. I opened the folder in VSC and then I am able to open the file. I click on F5 but then it asks me what kind of environment this is, well I thought it would be at least this smart that it could detect the extensions of the file and know that it is Powershell. Anyways I select the Powershell and it pops up with an json file. This is getting pretty creepy because just to run this small code requires me to understand json and lots of stuff, but just breathe and continue. Next I clicked again on F5 and it came with a debug console but no output from my variable, hmm… what is going on. I just wanted to write a simple script and run it, why all this fuzz about. I started extensions again and searched if there could be any shell that it would run on so I just typed in powershell and there where 3 extensions but I did not have a clue what I should choose, codeshell, code runner and start any shell. I just started with the first one and installed, enabled and restarted VSC. I typed F5 again and it came up with an error that had something to do with the json file. I just deleted the vcode folder and tried again and it ran but still no output. I went to view and there was something called output, I selected it and tried to run it again but no variable output. This was getting frustrated the first few minutes and I was not quite sure if this would be the perfect development platform for powershell scripts and at this point I just wanted to quit VSC so I decided that I did not want to continue. I would rather recommend PowerShell Studio from Sapien Technologies rather trying to develop powershell script in VSC.
PowerShell ISE is more of an small toolkit like notepad for PowerShell but Visual Studio Code is more of an development platform with debugging, breakpoints and lots of neat features. My recommendation if you are writing a simple code that will only be used in few cased I would just use PowerShell ISE which is included free in the Windows platform. If you want to do deep Powershell development I would go PowerShell Studio and of course if you want to bring PowerShell and C# together I would then use Visual Studio Code or other similar alternatives, I would go the alternatives.