From c7a8261be9331501719b4c5a93a588c25a6f26e2 Mon Sep 17 00:00:00 2001 From: Keith Hill Date: Sun, 31 Dec 2017 01:24:29 -0700 Subject: [PATCH 1/2] Update tasks.json to 2.0.0 schema and pwsh --- .vscode/tasks.json | 63 ++++++++++---------- chocolatey/tests/InstallChocolatey.Tests.ps1 | 2 +- 2 files changed, 31 insertions(+), 34 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 194358c5e..93a631b2d 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,49 +1,46 @@ -// Available variables which can be used inside of strings. -// ${workspaceRoot}: the root folder of the team -// ${file}: the current opened file -// ${relativeFile}: the current opened file relative to workspaceRoot -// ${fileBasename}: the current opened file's basename -// ${fileDirname}: the current opened file's dirname -// ${fileExtname}: the current opened file's extension -// ${cwd}: the current working directory of the spawned process { // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format - "version": "0.1.0", + "version": "2.0.0", - // Start PowerShell "windows": { - "command": "${env:windir}\\System32\\windowspowershell\\v1.0\\PowerShell.exe" + "options": { + "shell": { + "executable": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", + "args": [ "-NoProfile", "-ExecutionPolicy", "Bypass", "-Command" ] + } + } }, "linux": { - "command": "/usr/bin/powershell" + "options": { + "shell": { + "executable": "/usr/bin/pwsh", + "args": [ "-NoProfile", "-Command" ] + } + } }, "osx": { - "command": "/usr/local/bin/powershell" + "options": { + "shell": { + "executable": "/usr/local/bin/pwsh", + "args": [ "-NoProfile", "-Command" ] + } + } }, - // The command is a shell script - "isShellCommand": true, - - // Show the output window always - "showOutput": "always", - - "args": [ - "-NoProfile", "-ExecutionPolicy", "Bypass" - ], - // Associate with test task runner "tasks": [ { - "taskName": "Test", - "suppressTaskName": true, - "isTestCommand": true, - "showOutput": "always", - "args": [ - "Write-Host 'Invoking Pester'; Invoke-Pester test -PesterOption @{IncludeVSCodeMarker=$true};", - "Invoke-Command { Write-Host 'Completed Test task in task runner.' }" - ], - "problemMatcher": "$pester" + "label": "Test", + "type": "shell", + "command": "Invoke-Pester test -PesterOption @{IncludeVSCodeMarker=$true}", + "group": { + "kind": "test", + "isDefault": true + }, + "problemMatcher": [ + "$pester" + ] } - ] + ] } diff --git a/chocolatey/tests/InstallChocolatey.Tests.ps1 b/chocolatey/tests/InstallChocolatey.Tests.ps1 index fe470feec..3b271685f 100644 --- a/chocolatey/tests/InstallChocolatey.Tests.ps1 +++ b/chocolatey/tests/InstallChocolatey.Tests.ps1 @@ -3,7 +3,7 @@ cpack function Setup-Environment { Cleanup - $env:poshGit = join-path (Resolve-Path .\Tests ) dahlbyk-posh-git-60be436.zip + $env:poshGit = Join-Path (Resolve-Path $PSScriptRoot/tests) dahlbyk-posh-git-60be436.zip $profileScript = "function Prompt(){ `$host.ui.RawUI.WindowTitle = `"My Prompt`" }" (Set-Content $Profile -value $profileScript -Force) } From 9bb813b777f7a229e134a3714dd03f7d62ebc17f Mon Sep 17 00:00:00 2001 From: Keith Hill Date: Mon, 1 Jan 2018 12:28:12 -0700 Subject: [PATCH 2/2] Undo change that shouldn't be part of this PR --- chocolatey/tests/InstallChocolatey.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chocolatey/tests/InstallChocolatey.Tests.ps1 b/chocolatey/tests/InstallChocolatey.Tests.ps1 index 3b271685f..fe470feec 100644 --- a/chocolatey/tests/InstallChocolatey.Tests.ps1 +++ b/chocolatey/tests/InstallChocolatey.Tests.ps1 @@ -3,7 +3,7 @@ cpack function Setup-Environment { Cleanup - $env:poshGit = Join-Path (Resolve-Path $PSScriptRoot/tests) dahlbyk-posh-git-60be436.zip + $env:poshGit = join-path (Resolve-Path .\Tests ) dahlbyk-posh-git-60be436.zip $profileScript = "function Prompt(){ `$host.ui.RawUI.WindowTitle = `"My Prompt`" }" (Set-Content $Profile -value $profileScript -Force) }