I get the following error when starting VSCode after installing the VSCode-PowerShell 0.7.0 extension in VSCode 1.4.0:

This is running on a Windows 7 machine. Other members of my Dev team have the same issue.
The plugin (0.7.0) works fine on VSCode-Insiders v1.5.0.
Hey Daniel, is this PowerShell v2 or v3 running on Windows 7? We currently don't support PS v2.
Strange that VS Code 1.4 vs 1.5 Insiders would make a difference, it shouldn't have an impact... Is this on the same machine?
Hi @daviwil - It's PS4.0 on Windows 7.0. It is strange.
It works fine on VSCode 1.3.1 (I downgraded to confirm). I couldn't see any reason for this either. I'm just using the insiders build now anyway, so I'm not too worried. Thought it was worth reporting though.
Apparently there's some sort of issue in VS Code 1.4 that didn't show up until now. Bizarre! I think I've seen someone else with a similar error, I wonder if they've been affected by this one as well.
At any rate, thanks a lot for confirming which VS Code versions it was happening with! I'll keep the bug open for now to track this.
I was mistaken about it working on VSCode Insiders 1.5.0-insiders. It has the same problem on that version. I was mistaken because I hadn't yet clicked a PS1 file (only XML and MD files) so thought it worked. So same error is 1.5.0-insiders. Sorry about that.
Hmmm OK, so maybe there is something different in the later VS Code builds that's causing this. Thanks, I'll keep an eye out for that!

Just confirming it doesn't work on VSCode 1.3.1 or 1.4.0, also this looks to be a duplicate of #253
edit: Downgraded to vscode-powershell 0.6.0 and is working on Windows 7
@MoreThanHidden - good point about the duplicate. I note that #253 has the exact same configuration as I do:
Windows 7 x64, PS4.0
On all my Windows 10 machines this plugin and VSCode combo works just fine. Seems like it might be a Win7 or PS4.0 specified issue.
I am the someone else with this issue. I have the same setup as PlagueHO does and have the exact same issue.
The error results from syntax used that is only available in PS5.0 I guess.
e.g. in .vscode\extensions\ms-vscode.PowerShell-0.7.0\scripts\Start-EditorServices.ps1 the ::new Syntax is used throughout the whole file.
$tcpListener = [System.Net.Sockets.TcpListener]::new($ipAddress, $portNumber);
instead of
$tcpListener = New-Object System.Net.Sockets.TcpListener($ipAddress, $portNumber);
And that makes the whole extension crash.
After replacing all lines that use the ::new Syntax with New-Object, I get the following error in the logs:
powershell.exe started --
pid: 10124
exe: C:\WINDOWS\Sysnative\WindowsPowerShell\v1.0\powershell.exe
bundledModulesPath: C:\Users\10490184.vscode\extensions\ms-vscode.PowerShell-0.7.0\modules
args: C:\Users\10490184.vscode\extensions\ms-vscode.PowerShell-0.7.0\scripts\Start-EditorServices.ps1 -EditorServicesVersion "0.7.0" -HostName "Visual Studio Code Host" -HostProfileId "Microsoft.VSCode" -HostVersion "0.7.0" -BundledModulesPath "C:\Users\10490184.vscode\extensions\ms-vscode.PowerShell-0.7.0\modules" -LogLevel "Normal" -LogPath "C:\Users\10490184.vscode\extensions\ms-vscode.PowerShell-0.7.0\logs\1471957260-EditorServices.log"
ERROR: Add-Type : Unable to load one or more of the requested types. Retrieve the
LoaderExceptions property for more information.
ERROR: In C:\Users\10490184.vscode\extensions\ms-vscode.PowerShell-0.7.0\modules\Powe
rShellEditorServices\PowerShellEditorServices.psm1:2 Zeichen:5
+ CategoryInfo : NotSpecified: (:) [Add-Type], ReflectionTypeLoad
Exception
+ FullyQualifiedErrorId : System.Reflection.ReflectionTypeLoadException,Mi
crosoft.PowerShell.Commands.AddTypeCommand
OUTPUT: {"debugServicePort":16727,"status":"started","channel":"tcp","languageServicePort":13997}
Connecting to port: 13997
The LoaderExceptions property gives me the following:
Could not load type 'System.Management.Automation.Language.AstVisitor2' from assembly 'System.Management.Automation,
Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Thanks guys, I've already worked out all the issues in the PowerShell files but there is one more issue I need to take care of in the C# code for the language service. Putting that together now; if it works I'll ship an update in a few hours.
Thanks for your patience!
@daviwil Check you email. There is one other minor fix I'd like to get in there.
Ok, got things working again on Win7 with PSv3! Going to prepare a pull request and try to get a release prepared shortly.
Thanks @daviwil , @rkeithhill , @phunkodelic for helping us (not by choice) Windows 7 users! Heroes of the downtrodden and forgotten :grinning:
No problem as things like this happen all the time. I assume the new version that comes out will be 0.7.1 since it will have bug fixes in it? Keep up the good work as I have gotten used to using Visual Studio Code and like it much better then the ISE or other tools I have tried. Thanks!
Ran into a final issue while preparing the release, should get that resolved and new update shipped today.
@phunkodelic That's awesome to hear, thanks a lot!
Just shipped a new release with a fix for this issue! Let me know if it resolves everything for you.
Looking good, have been using it all day! Thanks @daviwil - really appreciate your work on this.
Looking good here, too! Thanks a lot @daviwil and keep up the good work!
@daviwil - Looks good here as I finally had a chance to try it. Thanks a lot for fixing it! Keep up the good work and keep those great new features coming.
Awesome, thanks a lot for letting me know!
Most helpful comment
Ok, got things working again on Win7 with PSv3! Going to prepare a pull request and try to get a release prepared shortly.