Port of schuchert.wikispaces.com


PowerShell5.YakShaving

PowerShell5.YakShaving

Overview

All of these tutorials are written using Windows 10 Professional, PowerShell 5.1, Pester, and Visual Studio Code. Here are the specifics.

While detailed setup instructions might come later, here are a few notes.

PowerShell

Pester

Visual Studio Code

Modules I’ve installed:

    {
        :go.microsoft.com/fwlink/?LinkId=733558
        // for the documentation about the tasks.json format
        "version": "2.0.0",
        "_runner": "terminal",
        "windows" : {
            "command":"powershell.exe"
        },
        "presentation": {
            "reveal": "always",
            "panel": "new"
        },
        "tasks": [
            {
                "taskName": "Run.AllTests",
                "type": "shell",
                "command": "Invoke-Pester",
                "problemMatcher": [
                    "$pester"
                ],
                "presentation": {
                    "echo": true,
                    "reveal": "always",
                    "focus": false,
                    "panel": "dedicated"
                }
            },
            {
                "taskName": "Run.CurrentFile",
                "type": "shell",
                "command": "Invoke-Pester",
                "args": [
                    "${file}"
                ],
                "problemMatcher": [
                    "$pester"
                ],
                "presentation": {
                    "echo": true,
                    "reveal": "always",
                    "focus": false,
                    "panel": "dedicated"
                }
            }
        ]
    }

Custom key bindings to run the custom tasks:

    [{
        "key": "ctrl+shift+alt+t",
        "command": "workbench.action.tasks.runTask",
        "args": "Run.AllTests",
        "when": "editorTextFocus"
    },
    {
        "key": "ctrl+shift+alt+f",
        "command": "workbench.action.tasks.runTask",
        "args": "Run.CurrentFile",
        "when": "editorTextFocus"
    }
    ]


Comments

" Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.