Skip to content

Commit 308b1bb

Browse files
authored
Merge pull request #258 from PowerShell/release/0.7.1
Release 0.7.1
2 parents 0fc0f3c + cef43ca commit 308b1bb

File tree

5 files changed

+41
-10
lines changed

5 files changed

+41
-10
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# vscode-powershell Release History
22

3+
## 0.7.1
4+
### Tuesday, August 23, 2016
5+
6+
- "Auto" variable scope in debugger UI now expands by default
7+
- Fixed #244: Extension fails to load if username contains spaces
8+
- Fixed #246: Restore default PSScriptAnalyzer ruleset
9+
- Fixed #248: Extension fails to load on Windows 7 with PowerShell v3
10+
311
## 0.7.0
412
### Thursday, August 18, 2016
513

README.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@
22

33
This extension provides rich PowerShell language support for Visual Studio Code.
44
Now you can write and debug PowerShell scripts using the excellent IDE-like interface
5-
that VS Code provides.
5+
that Visual Studio Code provides.
6+
7+
## Platform support
8+
9+
- **Windows 7 through 10** with PowerShell v3 and higher
10+
- **Linux** with PowerShell v6 (all PowerShell-supported distribtions)
11+
- **Mac OS X** with PowerShell v6
12+
13+
Read the [installation instructions](https://github.com/PowerShell/PowerShell/blob/master/docs/learning-powershell/using-vscode.md)
14+
to get more details on how to use the extension on these platforms.
615

716
## Features
817

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "PowerShell",
33
"displayName": "PowerShell",
4-
"version": "0.7.0",
4+
"version": "0.7.1",
55
"publisher": "ms-vscode",
66
"description": "Develop PowerShell scripts in Visual Studio Code!",
77
"engines": {

scripts/Start-EditorServices.ps1

+20-6
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ param(
5454
$ConfirmInstall
5555
)
5656

57+
# Are we running in PowerShell 5 or later?
58+
$isPS5orLater = $PSVersionTable.PSVersion.Major -ge 5
59+
5760
# This variable will be assigned later to contain information about
5861
# what happened while attempting to launch the PowerShell Editor
5962
# Services host
@@ -81,8 +84,14 @@ function Test-PortAvailability($PortNumber) {
8184
$portAvailable = $true;
8285

8386
try {
84-
$ipAddress = [System.Net.Dns]::GetHostEntryAsync("localhost").Result.AddressList[0];
85-
$tcpListener = [System.Net.Sockets.TcpListener]::new($ipAddress, $portNumber);
87+
if ($isPS5orLater) {
88+
$ipAddress = [System.Net.Dns]::GetHostEntryAsync("localhost").Result.AddressList[0];
89+
}
90+
else {
91+
$ipAddress = [System.Net.Dns]::GetHostEntry("localhost").AddressList[0];
92+
}
93+
94+
$tcpListener = New-Object System.Net.Sockets.TcpListener @($ipAddress, $portNumber)
8695
$tcpListener.Start();
8796
$tcpListener.Stop();
8897

@@ -100,7 +109,7 @@ function Test-PortAvailability($PortNumber) {
100109
return $portAvailable;
101110
}
102111

103-
$rand = [System.Random]::new()
112+
$rand = New-Object System.Random
104113
function Get-AvailablePort {
105114
$triesRemaining = 10;
106115

@@ -128,9 +137,9 @@ if ((Test-ModuleAvailable "PowerShellGet") -eq $false) {
128137

129138
# Check if the expected version of the PowerShell Editor Services
130139
# module is installed
131-
$parsedVersion = [System.Version]::new($EditorServicesVersion)
140+
$parsedVersion = New-Object System.Version @($EditorServicesVersion)
132141
if ((Test-ModuleAvailable "PowerShellEditorServices" -RequiredVersion $parsedVersion) -eq $false) {
133-
if ($ConfirmInstall) {
142+
if ($ConfirmInstall -and $isPS5orLater) {
134143
# TODO: Check for error and return failure if necessary
135144
Install-Module "PowerShellEditorServices" -RequiredVersion $parsedVersion -Confirm
136145
}
@@ -141,7 +150,12 @@ if ((Test-ModuleAvailable "PowerShellEditorServices" -RequiredVersion $parsedVer
141150
}
142151
}
143152

144-
Import-Module PowerShellEditorServices -RequiredVersion $parsedVersion -ErrorAction Stop
153+
if ($isPS5orLater) {
154+
Import-Module PowerShellEditorServices -RequiredVersion $parsedVersion -ErrorAction Stop
155+
}
156+
else {
157+
Import-Module PowerShellEditorServices -Version $parsedVersion -ErrorAction Stop
158+
}
145159

146160
# Locate available port numbers for services
147161
$languageServicePort = Get-AvailablePort

src/main.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import net = require('net');
2525

2626
// NOTE: We will need to find a better way to deal with the required
2727
// PS Editor Services version...
28-
var requiredEditorServicesVersion = "0.7.0";
28+
var requiredEditorServicesVersion = "0.7.1";
2929

3030
var powerShellProcess: cp.ChildProcess = undefined;
3131
var languageServerClient: LanguageClient = undefined;
@@ -177,7 +177,7 @@ function startPowerShell(powerShellExePath: string, bundledModulesPath: string,
177177

178178
// Add the Start-EditorServices.ps1 invocation arguments
179179
args.push('-Command')
180-
args.push(startScriptPath + ' ' + startArgs)
180+
args.push('& "' + startScriptPath + '" ' + startArgs)
181181

182182
// Launch PowerShell as child process
183183
powerShellProcess = cp.spawn(powerShellExePath, args);

0 commit comments

Comments
 (0)