-
Notifications
You must be signed in to change notification settings - Fork 511
Start-EditorServices.ps1: [System.Random]::new() errors in Windows with Powershell 4 #248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm seeing the same issue since updating to 0.7 this morning. Win 8.1 & PS 4, e.g.
Also includes several others e.g.: |
I'll just add that I'm seeing the same issue on Win7x64 (PowerShell v3). |
Hi guys, thanks for the report! There's definitely an issue on older Windows systems, I'll try to ship an update early next week to address this. In the meantime you can remove the installed PowerShell extension and download one of the older releases from our releases page. Just extract the previous release package into |
This change resolves some compatibility issues with PowerShell v3 and v4. The new PowerShellEditorServices.psm1 file was using the ::new() constructor syntax that is only available in PowerShell v5 and higher. Also, the AstVisitor2 class was causing issues with Add-Type when being loaded into the older versions of PowerShell. Issue #276 tracks the need for bringing AstVisitor2 usage back after a more appropriate multi-version support strategy is designed. Related to PowerShell/vscode-powershell#248
This change resolves some compatibility issues with PowerShell v3 and v4. The new PowerShellEditorServices.psm1 file was using the ::new() constructor syntax that is only available in PowerShell v5 and higher. Also, the AstVisitor2 class was causing issues with Add-Type when being loaded into the older versions of PowerShell. Issue #276 tracks the need for bringing AstVisitor2 usage back after a more appropriate multi-version support strategy is designed. Related to PowerShell/vscode-powershell#248
This change fixes #248 which reports that the extension cannot be loaded on Windows 7 machines running PowerShell v3 (and probably also any machine running PowerShell v4). The Start-EditorServices.ps1 script relied in features only present in PowerShell v5. New code paths have been added to the script to make it compatible with v3 and v4.
Just shipped a new release with a fix for this issue! Let me know if it resolves everything for you. |
Running on Windows 8 (Powershell v3) & Windows 2012r2 (Powershell 4) from logs:
powershell.exe started --
pid: 8304
exe: C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe
bundledModulesPath: C:\Users\BB45210.vscode\extensions\ms-vscode.PowerShell-0.7.0\modules
args: C:\Users\BB45210.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\BB45210.vscode\extensions\ms-vscode.PowerShell-0.7.0\modules" -LogLevel "Verbose" -LogPath "C:\Users\BB45210.vscode\extensions\ms-vscode.PowerShell-0.7.0\logs\1471588439-EditorServices.log"
ERROR: Method invocation failed because [System.Version] doesn't contain a method
ERROR: named 'new'.
The text was updated successfully, but these errors were encountered: