Skip to content

Release 0.7.1 #258

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

Merged
merged 5 commits into from
Aug 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
26 changes: 20 additions & 6 deletions scripts/Start-EditorServices.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();

Expand All @@ -100,7 +109,7 @@ function Test-PortAvailability($PortNumber) {
return $portAvailable;
}

$rand = [System.Random]::new()
$rand = New-Object System.Random
function Get-AvailablePort {
$triesRemaining = 10;

Expand Down Expand Up @@ -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
}
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down