Skip to content

Latest commit

 

History

History
44 lines (36 loc) · 1.18 KB

Consuming.md

File metadata and controls

44 lines (36 loc) · 1.18 KB

Consuming the SDK

Dependencies

  • The SDK requires PowerShell 3 or higher.
  • The SDK is designed for use with PowerShell.exe (Console Host).
  • A TFS 2015 Update 2 Windows agent (or higher) is required to run a PowerShell3 task end-to-end. However, an agent is not required for interactively testing the task.

Where to get it

Save-Module -Name VstsTaskSdk -Path .\

or install a specific version:

Save-Module -Name VstsTaskSdk -Path .\ -RequiredVersion 0.7.0

task.json modifications

Use the PowerShell3 execution handler and set the target to the entry PS1 script. The entry PS1 script should be located in the root of the task folder.

{
    "execution": {
        "PowerShell3": {
            "target": "MyTask.ps1"
        },
    }
}

Package the SDK with the task

The SDK should be packaged with the task in a ps_modules folder. The ps_modules folder should be in the root of the task folder.

Example layout: Consider the following layout where MyTask is the root folder for the task.

MyTask
|   MyTask.ps1
│   task.json
└───ps_modules
    └───VstsTaskSdk
            [...]
            VstsTaskSdk.psd1