Ressources/FRPSUGModuleTemplate/vscode/tasks_psake.json

{
    "version": "2.0.0",
    "windows": {
        "command": "${env:windir}/System32/WindowsPowerShell/v1.0/powershell.exe",
        "args": [
            "-NoProfile",
            "-ExecutionPolicy",
            "Bypass",
            "-command"
        ]
    },
    "linux": {
        "command": "/usr/bin/pwsh",
        "args": [
            "-NoProfile"
        ]
    },
    "osx": {
        "command": "/usr/local/bin/pwsh",
        "args": [
            "-NoProfile"
        ]
    },
    "type": "shell",
    "presentation": {
        "echo": false,
        "reveal": "always",
        "focus": true,
        "panel": "dedicated",
        "showReuseMessage": false,
        "clear": true
    },
    "tasks": [
        {
            "label": "AllPesterTest",
            "type": "shell",
            "group": "test",
            "presentation": {
                "echo": false,
                "reveal": "always",
                "focus": true,
                "panel": "dedicated",
                "showReuseMessage": true,
                "clear": true
            },
            "command": "Write-Host 'Invoking Pester...'; $ProgressPreference = 'SilentlyContinue'; Invoke-Pester -PesterOption @{IncludeVSCodeMarker=$true};Invoke-Command { Write-Host 'Completed Test task in task runner.' }",
            "problemMatcher": "$pester"
        },
        {
            "label": "Clean",
            "type": "shell",
            "group": "build",
            "presentation": {
                "echo": false,
                "reveal": "always",
                "focus": true,
                "panel": "dedicated",
                "showReuseMessage": false,
                "clear": true
            },
            "command": "Write-Host 'Invoking PSake Clean task on ${workspaceFolderBasename} module ...';Invoke-psake -buildFile ${workspaceFolder}/Tasks/${workspaceFolderBasename}.Tasks.ps1 -taskList Clean",
            "problemMatcher": []
        },
        {
            "label": "Compile",
            "type": "shell",
            "group": "build",
            "presentation": {
                "echo": false,
                "reveal": "always",
                "focus": true,
                "panel": "dedicated",
                "showReuseMessage": false,
                "clear": true
            },
            "command": "Write-Host 'Invoking PSake Compile task on ${workspaceFolderBasename} module...';Invoke-psake -buildFile ${workspaceFolder}/Tasks/${workspaceFolderBasename}.Tasks.ps1 -taskList compile",
            "problemMatcher": []
        },
        {
            "label": "Run All UnitTests",
            "type": "shell",
            "group": "build",
            "presentation": {
                "echo": false,
                "reveal": "always",
                "focus": true,
                "panel": "dedicated",
                "showReuseMessage": false,
                "clear": true
            },
            "command": "Write-Host 'Invoking PSake Test task on ${workspaceFolderBasename} module...';Invoke-psake -buildFile ${workspaceFolder}/Tasks/${workspaceFolderBasename}.Tasks.ps1 -taskList tests",
            "problemMatcher": []
        },
        {
            "label": "Generate Diagram",
            "type": "shell",
            "group": "build",
            "presentation": {
                "echo": false,
                "reveal": "always",
                "focus": true,
                "panel": "dedicated",
                "showReuseMessage": false,
                "clear": true
            },
            "command": "Write-Host 'Invoking PSake Diagram task on ${workspaceFolderBasename} module...';Invoke-psake -buildFile ${workspaceFolder}/Tasks/${workspaceFolderBasename}.Tasks.ps1 -taskList Diagram",
            "problemMatcher": []
        },
        {
            "label": "Generate Docs",
            "type": "shell",
            "group": "build",
            "presentation": {
                "echo": false,
                "reveal": "always",
                "focus": true,
                "panel": "dedicated",
                "showReuseMessage": false,
                "clear": true
            },
            "command": "Write-Host 'Invoking PSake Docs task on ${workspaceFolderBasename} module ...';Invoke-psake -buildFile ${workspaceFolder}/Tasks/${workspaceFolderBasename}.Tasks.ps1 -taskList Docs",
            "problemMatcher": []
        },
        {
            "label": "Deploy",
            "type": "shell",
            "group": "build",
            "presentation": {
                "echo": false,
                "reveal": "always",
                "focus": true,
                "panel": "dedicated",
                "showReuseMessage": false,
                "clear": true
            },
            "command": "Write-Host 'Invoking PSake Deploy task on ${workspaceFolderBasename}...';Invoke-psake -buildFile ${workspaceFolder}/Tasks/${workspaceFolderBasename}.Tasks.ps1 -taskList deploy -parameters @{'DeployType' = '${input:DeployType}'}",
            "problemMatcher": []
        }
    ],
    "inputs": [
        {
            "id": "DeployType",
            "description": "What type of deploy do you want ?",
            "default": "DEV",
            "type": "pickString",
            "options": [
                "DEV",
                "Prod",
                "Support",
                "PSGallery"
            ]
        }
    ]
}