diff --git a/CHANGELOG.md b/CHANGELOG.md index cea1bc9247..11405f0d77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # vscode-powershell Release History +## 0.7.1 +### Tuesday, August 23, 2016 + +- "Auto" variable scope in debugger UI now expands by default +- Fixed #244: Extension fails to load if username contains spaces +- Fixed #246: Restore default PSScriptAnalyzer ruleset +- Fixed #248: Extension fails to load on Windows 7 with PowerShell v3 + ## 0.7.0 ### Thursday, August 18, 2016 diff --git a/README.md b/README.md index bc7ecaea08..a320b6fa3b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,16 @@ This extension provides rich PowerShell language support for Visual Studio Code. Now you can write and debug PowerShell scripts using the excellent IDE-like interface -that VS Code provides. +that Visual Studio Code provides. + +## Platform support + +- **Windows 7 through 10** with PowerShell v3 and higher +- **Linux** with PowerShell v6 (all PowerShell-supported distribtions) +- **Mac OS X** with PowerShell v6 + +Read the [installation instructions](https://github.com/PowerShell/PowerShell/blob/master/docs/learning-powershell/using-vscode.md) +to get more details on how to use the extension on these platforms. ## Features diff --git a/package.json b/package.json index c9aa04bca4..b0cd293dd4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "PowerShell", "displayName": "PowerShell", - "version": "0.7.0", + "version": "0.7.1", "publisher": "ms-vscode", "description": "Develop PowerShell scripts in Visual Studio Code!", "engines": { diff --git a/scripts/Start-EditorServices.ps1 b/scripts/Start-EditorServices.ps1 index 4b343135b5..f447f20208 100644 --- a/scripts/Start-EditorServices.ps1 +++ b/scripts/Start-EditorServices.ps1 @@ -54,6 +54,9 @@ param( $ConfirmInstall ) +# Are we running in PowerShell 5 or later? +$isPS5orLater = $PSVersionTable.PSVersion.Major -ge 5 + # This variable will be assigned later to contain information about # what happened while attempting to launch the PowerShell Editor # Services host @@ -81,8 +84,14 @@ function Test-PortAvailability($PortNumber) { $portAvailable = $true; try { - $ipAddress = [System.Net.Dns]::GetHostEntryAsync("localhost").Result.AddressList[0]; - $tcpListener = [System.Net.Sockets.TcpListener]::new($ipAddress, $portNumber); + if ($isPS5orLater) { + $ipAddress = [System.Net.Dns]::GetHostEntryAsync("localhost").Result.AddressList[0]; + } + else { + $ipAddress = [System.Net.Dns]::GetHostEntry("localhost").AddressList[0]; + } + + $tcpListener = New-Object System.Net.Sockets.TcpListener @($ipAddress, $portNumber) $tcpListener.Start(); $tcpListener.Stop(); @@ -100,7 +109,7 @@ function Test-PortAvailability($PortNumber) { return $portAvailable; } -$rand = [System.Random]::new() +$rand = New-Object System.Random function Get-AvailablePort { $triesRemaining = 10; @@ -128,9 +137,9 @@ if ((Test-ModuleAvailable "PowerShellGet") -eq $false) { # Check if the expected version of the PowerShell Editor Services # module is installed -$parsedVersion = [System.Version]::new($EditorServicesVersion) +$parsedVersion = New-Object System.Version @($EditorServicesVersion) if ((Test-ModuleAvailable "PowerShellEditorServices" -RequiredVersion $parsedVersion) -eq $false) { - if ($ConfirmInstall) { + if ($ConfirmInstall -and $isPS5orLater) { # TODO: Check for error and return failure if necessary Install-Module "PowerShellEditorServices" -RequiredVersion $parsedVersion -Confirm } @@ -141,7 +150,12 @@ if ((Test-ModuleAvailable "PowerShellEditorServices" -RequiredVersion $parsedVer } } -Import-Module PowerShellEditorServices -RequiredVersion $parsedVersion -ErrorAction Stop +if ($isPS5orLater) { + Import-Module PowerShellEditorServices -RequiredVersion $parsedVersion -ErrorAction Stop +} +else { + Import-Module PowerShellEditorServices -Version $parsedVersion -ErrorAction Stop +} # Locate available port numbers for services $languageServicePort = Get-AvailablePort diff --git a/src/main.ts b/src/main.ts index 0f2a9bbe66..76f4923b2e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -25,7 +25,7 @@ import net = require('net'); // NOTE: We will need to find a better way to deal with the required // PS Editor Services version... -var requiredEditorServicesVersion = "0.7.0"; +var requiredEditorServicesVersion = "0.7.1"; var powerShellProcess: cp.ChildProcess = undefined; var languageServerClient: LanguageClient = undefined; @@ -177,7 +177,7 @@ function startPowerShell(powerShellExePath: string, bundledModulesPath: string, // Add the Start-EditorServices.ps1 invocation arguments args.push('-Command') - args.push(startScriptPath + ' ' + startArgs) + args.push('& "' + startScriptPath + '" ' + startArgs) // Launch PowerShell as child process powerShellProcess = cp.spawn(powerShellExePath, args);