From 55d7995ab0d21c2d33d3d73c3a775a064c375b86 Mon Sep 17 00:00:00 2001 From: Keith Hill Date: Wed, 29 Nov 2017 21:57:11 -0700 Subject: [PATCH 1/2] Update Examples tasks.json for 2.0 schema Fix #1111 --- examples/.vscode/tasks.json | 91 +++++++++++++++++++++---------------- 1 file changed, 52 insertions(+), 39 deletions(-) diff --git a/examples/.vscode/tasks.json b/examples/.vscode/tasks.json index a3033d4af5..994cb0926e 100644 --- a/examples/.vscode/tasks.json +++ b/examples/.vscode/tasks.json @@ -1,7 +1,6 @@ // A task runner that invokes Pester to run all Pester tests under the // current workspace folder. - -// NOTE: This Test task runner requires an updated version of Pester (>=3.4.0) +// NOTE: This Test task runner requires an updated version of Pester (>=4.0.3) // in order for the problemMatcher to find failed test information (message, line, file). // If you don't have that version, you can update Pester from the PowerShell Gallery // with this command: @@ -14,13 +13,11 @@ // // PS C:\> Install-Module Pester -Scope CurrentUser -Force // - // NOTE: The Clean, Build and Publish tasks require PSake. PSake can be installed // from the PowerShell Gallery with this command: // // PS C:\> Install-Module PSake -Scope CurrentUser -Force // - // Available variables which can be used inside of strings. // ${workspaceRoot}: the root folder of the team // ${file}: the current opened file @@ -29,58 +26,74 @@ // ${fileExtname}: the current opened file's extension // ${cwd}: the current working directory of the spawned process { - "version": "2.0.0", + "version": "2.0.0", - // Start PowerShell "windows": { - "command": "${env:windir}/System32/WindowsPowerShell/v1.0/powershell.exe", - "args": [ "-NoProfile", "-ExecutionPolicy", "Bypass" ] + "options": { + "shell": { + "executable": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", + "args": [ + "-NoProfile", + "-ExecutionPolicy", + "Bypass", + "-Command" + ] + } + } }, "linux": { - "command": "/usr/bin/powershell", - "args": [ "-NoProfile" ] + "options": { + "shell": { + "executable": "/usr/bin/pwsh", + "args": [ + "-NoProfile", + "-Command" + ] + } + } }, "osx": { - "command": "/usr/local/bin/powershell", - "args": [ "-NoProfile" ] + "options": { + "shell": { + "executable": "/usr/local/bin/pwsh", + "args": [ + "-NoProfile", + "-Command" + ] + } + } }, // Associate with test task runner "tasks": [ { - "taskName": "Clean", - "suppressTaskName": true, - "args": [ - "Write-Host 'Invoking PSake...'; Invoke-PSake build.ps1 -taskList Clean;", - "Invoke-Command { Write-Host 'Completed Clean task in task runner.' }" - ] + "label": "Clean", + "type": "shell", + "command": "Invoke-PSake build.ps1 -taskList Clean" }, { - "taskName": "Build", - "suppressTaskName": true, - "isBuildCommand": true, - "args": [ - "Write-Host 'Invoking PSake...'; Invoke-PSake build.ps1 -taskList Build;", - "Invoke-Command { Write-Host 'Completed Build task in task runner.' }" - ] + "label": "Build", + "type": "shell", + "command": "Invoke-PSake build.ps1 -taskList Build", + "group": { + "kind": "build", + "isDefault": true + } }, { - "taskName": "Publish", - "suppressTaskName": true, - "args": [ - "Write-Host 'Invoking PSake...'; Invoke-PSake build.ps1 -taskList Publish;", - "Invoke-Command { Write-Host 'Completed Publish task in task runner.' }" - ] + "label": "Test", + "type": "shell", + "command": "Invoke-Pester -PesterOption @{IncludeVSCodeMarker=$true}", + "group": { + "kind": "test", + "isDefault": true + }, + "problemMatcher": "$pester" }, { - "taskName": "Test", - "suppressTaskName": true, - "isTestCommand": true, - "args": [ - "Write-Host 'Invoking Pester...'; $ProgressPreference = 'SilentlyContinue'; Invoke-Pester -PesterOption @{IncludeVSCodeMarker=$true};", - "Invoke-Command { Write-Host 'Completed Test task in task runner.' }" - ], - "problemMatcher": "$pester" + "label": "Publish", + "type": "shell", + "command": "Invoke-PSake build.ps1 -taskList Publish" } ] } From bb021b820cded9b20ba70613f549ceeb9d00f7d8 Mon Sep 17 00:00:00 2001 From: Keith Hill Date: Wed, 29 Nov 2017 22:02:43 -0700 Subject: [PATCH 2/2] Update info on available variables --- examples/.vscode/tasks.json | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/examples/.vscode/tasks.json b/examples/.vscode/tasks.json index 994cb0926e..9c5bf45ce1 100644 --- a/examples/.vscode/tasks.json +++ b/examples/.vscode/tasks.json @@ -18,16 +18,19 @@ // // PS C:\> Install-Module PSake -Scope CurrentUser -Force // -// Available variables which can be used inside of strings. -// ${workspaceRoot}: the root folder of the team -// ${file}: the current opened file -// ${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 +// Available variables which can be used inside of strings: +// ${workspaceFolder} the path of the workspace folder that contains the tasks.json file +// ${workspaceFolderBasename} the name of the workspace folder that contains the tasks.json file without any slashes (/) +// ${file} the current opened file +// ${relativeFile} the current opened file relative to the workspace folder containing the file +// ${fileBasename} the current opened file's basename +// ${fileBasenameNoExtension} the current opened file's basename without the extension +// ${fileDirname} the current opened file's dirname +// ${fileExtname} the current opened file's extension +// ${cwd} the task runner's current working directory on startup +// ${lineNumber} the current selected line number in the active file { "version": "2.0.0", - "windows": { "options": { "shell": { @@ -63,8 +66,6 @@ } } }, - - // Associate with test task runner "tasks": [ { "label": "Clean", @@ -88,7 +89,9 @@ "kind": "test", "isDefault": true }, - "problemMatcher": "$pester" + "problemMatcher": [ + "$pester" + ] }, { "label": "Publish",