Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
4 contributors

Users who have contributed to this file

@ericsciple @TingluoHuang @pascalberger @damccorm
807 lines (665 sloc) 26.3 KB

Commands (v0.11.0)

Table of Contents

Find

Find-VstsMatch

table of contents | full

NAME
    Find-VstsMatch

SYNOPSIS
    Finds files using match patterns.

SYNTAX
    Find-VstsMatch [[-DefaultRoot] <String>] [[-Pattern] <String[]>] [[-FindOptions] <Object>]
    [[-MatchOptions] <Object>] [<CommonParameters>]

DESCRIPTION
    Determines the find root from a list of patterns. Performs the find and then applies the glob patterns.
    Supports interleaved exclude patterns. Unrooted patterns are rooted using defaultRoot, unless
    matchOptions.matchBase is specified and the pattern is a basename only. For matchBase cases, the
    defaultRoot is used as the find root.

New-VstsFindOptions

table of contents | full

NAME
    New-VstsFindOptions

SYNOPSIS
    Creates FindOptions for use with Find-VstsMatch.

SYNTAX
    New-VstsFindOptions [-FollowSpecifiedSymbolicLink] [-FollowSymbolicLinks] [<CommonParameters>]

DESCRIPTION
    Creates FindOptions for use with Find-VstsMatch. Contains switches to control whether to follow symlinks.

New-VstsMatchOptions

table of contents | full

NAME
    New-VstsMatchOptions

SYNOPSIS
    Creates MatchOptions for use with Find-VstsMatch and Select-VstsMatch.

SYNTAX
    New-VstsMatchOptions [-Dot] [-FlipNegate] [-MatchBase] [-NoBrace] [-NoCase] [-NoComment] [-NoExt]
    [-NoGlobStar] [-NoNegate] [-NoNull] [<CommonParameters>]

DESCRIPTION
    Creates MatchOptions for use with Find-VstsMatch and Select-VstsMatch. Contains switches to control which
    pattern matching options are applied.

Select-VstsMatch

table of contents | full

NAME
    Select-VstsMatch

SYNOPSIS
    Applies match patterns against a list of files.

SYNTAX
    Select-VstsMatch [[-ItemPath] <String[]>] [[-Pattern] <String[]>] [[-PatternRoot] <String>] [[-Options]
    <Object>] [<CommonParameters>]

DESCRIPTION
    Applies match patterns to a list of paths. Supports interleaved exclude patterns.

Input

Get-VstsEndpoint

table of contents | full

NAME
    Get-VstsEndpoint

SYNOPSIS
    Gets an endpoint.

SYNTAX
    Get-VstsEndpoint [-Name] <String> [-Require] [<CommonParameters>]

DESCRIPTION
    Gets an endpoint object for the specified endpoint name. The endpoint is returned as an object with three
    properties: Auth, Data, and Url.

    The Data property requires a 1.97 agent or higher.

Get-VstsInput

table of contents | full

NAME
    Get-VstsInput

SYNOPSIS
    Gets an input.

SYNTAX
    Get-VstsInput -Name <String> [-Require] [-AsBool] [-AsInt] [<CommonParameters>]

    Get-VstsInput -Name <String> [-Default <Object>] [-AsBool] [-AsInt] [<CommonParameters>]

DESCRIPTION
    Gets the value for the specified input name.

Get-VstsSecureFileName

table of contents | full

NAME
    Get-VstsSecureFileName

SYNOPSIS
    Gets a secure file name.

SYNTAX
    Get-VstsSecureFileName [-Id] <String> [-Require] [<CommonParameters>]

DESCRIPTION
    Gets the name for a secure file.

Get-VstsSecureFileTicket

table of contents | full

NAME
    Get-VstsSecureFileTicket

SYNOPSIS
    Gets a secure file ticket.

SYNTAX
    Get-VstsSecureFileTicket [-Id] <String> [-Require] [<CommonParameters>]

DESCRIPTION
    Gets the secure file ticket that can be used to download the secure file contents.

Get-VstsTaskVariable

table of contents | full

NAME
    Get-VstsTaskVariable

SYNOPSIS
    Gets a task variable.

SYNTAX
    Get-VstsTaskVariable -Name <String> [-Require] [-AsBool] [-AsInt] [<CommonParameters>]

    Get-VstsTaskVariable -Name <String> [-Default <Object>] [-AsBool] [-AsInt] [<CommonParameters>]

DESCRIPTION
    Gets the value for the specified task variable.

Get-VstsTaskVariableInfo

table of contents | full

NAME
    Get-VstsTaskVariableInfo

SYNOPSIS
    Gets all job variables available to the task. Requires 2.104.1 agent or higher.

SYNTAX
    Get-VstsTaskVariableInfo [<CommonParameters>]

DESCRIPTION
    Gets a snapshot of the current state of all job variables available to the task.
    Requires a 2.104.1 agent or higher for full functionality.

    Returns an array of objects with the following properties:
        [string]Name
        [string]Value
        [bool]Secret

    Limitations on an agent prior to 2.104.1:
     1) The return value does not include all public variables. Only public variables
        that have been added using setVariable are returned.
     2) The name returned for each secret variable is the formatted environment variable
        name, not the actual variable name (unless it was set explicitly at runtime using
        setVariable).

Set-VstsTaskVariable

table of contents | full

NAME
    Set-VstsTaskVariable

SYNOPSIS
    Sets a task variable.

SYNTAX
    Set-VstsTaskVariable [-Name] <String> [[-Value] <String>] [-Secret] [<CommonParameters>]

DESCRIPTION
    Sets a task variable in the current task context as well as in the current job context. This allows the
    task variable to retrieved by subsequent tasks within the same job.

Legacy Find

Find-VstsFiles

table of contents | full

NAME
    Find-VstsFiles

SYNOPSIS
    Finds files or directories.

SYNTAX
    Find-VstsFiles [[-LiteralDirectory] <String>] [-LegacyPattern] <String> [-IncludeFiles]
    [-IncludeDirectories] [-Force] [<CommonParameters>]

DESCRIPTION
    Finds files or directories using advanced pattern matching.

Localization

Get-VstsLocString

table of contents | full

NAME
    Get-VstsLocString

SYNOPSIS
    Gets a localized resource string.

SYNTAX
    Get-VstsLocString [-Key] <String> [[-ArgumentList] <Object[]>] [<CommonParameters>]

DESCRIPTION
    Gets a localized resource string and optionally formats the string with arguments.

    If the format fails (due to a bad format string or incorrect expected arguments in the format string),
    then the format string is returned followed by each of the arguments (delimited by a space).

    If the lookup key is not found, then the lookup key is returned followed by each of the arguments
    (delimited by a space).

Import-VstsLocStrings

table of contents | full

NAME
    Import-VstsLocStrings

SYNOPSIS
    Imports resource strings for use with Get-VstsLocString.

SYNTAX
    Import-VstsLocStrings [-LiteralPath] <String> [<CommonParameters>]

DESCRIPTION
    Imports resource strings for use with Get-VstsLocString. The imported strings are stored in an internal
    resource string dictionary. Optionally, if a separate resource file for the current culture exists, then
    the localized strings from that file then imported (overlaid) into the same internal resource string
    dictionary.

    Resource strings from the SDK are prefixed with "PSLIB_". This prefix should be avoided for custom
    resource strings.

Logging Command

Write-VstsAddAttachment

table of contents | full

NAME
    Write-VstsAddAttachment

SYNOPSIS
    See https://github.com/Microsoft/vsts-tasks/blob/master/docs/authoring/commands.md

SYNTAX
    Write-VstsAddAttachment [-Type] <String> [-Name] <String> [-Path] <String> [-AsOutput]
    [<CommonParameters>]

Write-VstsAddBuildTag

table of contents | full

NAME
    Write-VstsAddBuildTag

SYNOPSIS
    See https://github.com/Microsoft/vsts-tasks/blob/master/docs/authoring/commands.md

SYNTAX
    Write-VstsAddBuildTag [-Value] <String> [-AsOutput] [<CommonParameters>]

Write-VstsAssociateArtifact

table of contents | full

NAME
    Write-VstsAssociateArtifact

SYNOPSIS
    See https://github.com/Microsoft/vsts-tasks/blob/master/docs/authoring/commands.md

SYNTAX
    Write-VstsAssociateArtifact [-Name] <String> [-Path] <String> [-Type] <String> [[-Properties]
    <Hashtable>] [-AsOutput] [<CommonParameters>]

Write-VstsLogDetail

table of contents | full

NAME
    Write-VstsLogDetail

SYNOPSIS
    See https://github.com/Microsoft/vsts-tasks/blob/master/docs/authoring/commands.md

SYNTAX
    Write-VstsLogDetail [-Id] <Guid> [[-ParentId] <Object>] [[-Type] <String>] [[-Name] <String>] [[-Order]
    <Object>] [[-StartTime] <Object>] [[-FinishTime] <Object>] [[-Progress] <Object>] [[-State] <Object>]
    [[-Result] <Object>] [[-Message] <String>] [-AsOutput] [<CommonParameters>]

Write-VstsPrependPath

table of contents | full

NAME
    Write-VstsPrependPath

SYNOPSIS
    See https://github.com/Microsoft/vsts-tasks/blob/master/docs/authoring/commands.md

SYNTAX
    Write-VstsPrependPath [-Path] <String> [-AsOutput] [<CommonParameters>]

Write-VstsSetEndpoint

table of contents | full

NAME
    Write-VstsSetEndpoint

SYNOPSIS
    See https://github.com/Microsoft/vsts-tasks/blob/master/docs/authoring/commands.md

SYNTAX
    Write-VstsSetEndpoint [-Id] <String> [-Field] <String> [-Key] <String> [-Value] <String> [-AsOutput]
    [<CommonParameters>]

Write-VstsSetProgress

table of contents | full

NAME
    Write-VstsSetProgress

SYNOPSIS
    See https://github.com/Microsoft/vsts-tasks/blob/master/docs/authoring/commands.md

SYNTAX
    Write-VstsSetProgress [-Percent] <Int32> [[-CurrentOperation] <String>] [-AsOutput] [<CommonParameters>]

Write-VstsSetResult

table of contents | full

NAME
    Write-VstsSetResult

SYNOPSIS
    See https://github.com/Microsoft/vsts-tasks/blob/master/docs/authoring/commands.md

SYNTAX
    Write-VstsSetResult -Result <String> [-Message <String>] [-AsOutput] [<CommonParameters>]

    Write-VstsSetResult -Result <String> [-Message <String>] [-DoNotThrow] [<CommonParameters>]

Write-VstsSetSecret

table of contents | full

NAME
    Write-VstsSetSecret

SYNOPSIS
    See https://github.com/Microsoft/vsts-tasks/blob/master/docs/authoring/commands.md

SYNTAX
    Write-VstsSetSecret [-Value] <String> [-AsOutput] [<CommonParameters>]

Write-VstsSetVariable

table of contents | full

NAME
    Write-VstsSetVariable

SYNOPSIS
    See https://github.com/Microsoft/vsts-tasks/blob/master/docs/authoring/commands.md

SYNTAX
    Write-VstsSetVariable [-Name] <String> [[-Value] <String>] [-Secret] [-AsOutput] [<CommonParameters>]

Write-VstsTaskDebug

table of contents | full

NAME
    Write-VstsTaskDebug

SYNOPSIS
    See https://github.com/Microsoft/vsts-tasks/blob/master/docs/authoring/commands.md

SYNTAX
    Write-VstsTaskDebug [[-Message] <String>] [-AsOutput] [<CommonParameters>]

Write-VstsTaskError

table of contents | full

NAME
    Write-VstsTaskError

SYNOPSIS
    See https://github.com/Microsoft/vsts-tasks/blob/master/docs/authoring/commands.md

SYNTAX
    Write-VstsTaskError [[-Message] <String>] [[-ErrCode] <String>] [[-SourcePath] <String>] [[-LineNumber]
    <String>] [[-ColumnNumber] <String>] [-AsOutput] [<CommonParameters>]

Write-VstsTaskVerbose

table of contents | full

NAME
    Write-VstsTaskVerbose

SYNOPSIS
    See https://github.com/Microsoft/vsts-tasks/blob/master/docs/authoring/commands.md

SYNTAX
    Write-VstsTaskVerbose [[-Message] <String>] [-AsOutput] [<CommonParameters>]

Write-VstsTaskWarning

table of contents | full

NAME
    Write-VstsTaskWarning

SYNOPSIS
    See https://github.com/Microsoft/vsts-tasks/blob/master/docs/authoring/commands.md

SYNTAX
    Write-VstsTaskWarning [[-Message] <String>] [[-ErrCode] <String>] [[-SourcePath] <String>] [[-LineNumber]
    <String>] [[-ColumnNumber] <String>] [-AsOutput] [<CommonParameters>]

Write-VstsUpdateBuildNumber

table of contents | full

NAME
    Write-VstsUpdateBuildNumber

SYNOPSIS
    See https://github.com/Microsoft/vsts-tasks/blob/master/docs/authoring/commands.md

SYNTAX
    Write-VstsUpdateBuildNumber [-Value] <String> [-AsOutput] [<CommonParameters>]

Write-VstsUpdateReleaseName

table of contents | full

NAME
    Write-VstsUpdateReleaseName

SYNOPSIS
    See https://github.com/Microsoft/vsts-tasks/blob/master/docs/authoring/commands.md

SYNTAX
    Write-VstsUpdateReleaseName [-Name] <String> [-AsOutput] [<CommonParameters>]

Write-VstsUploadArtifact

table of contents | full

NAME
    Write-VstsUploadArtifact

SYNOPSIS
    See https://github.com/Microsoft/vsts-tasks/blob/master/docs/authoring/commands.md

SYNTAX
    Write-VstsUploadArtifact [-ContainerFolder] <String> [-Name] <String> [-Path] <String> [-AsOutput]
    [<CommonParameters>]

Write-VstsUploadBuildLog

table of contents | full

NAME
    Write-VstsUploadBuildLog

SYNOPSIS
    See https://github.com/Microsoft/vsts-tasks/blob/master/docs/authoring/commands.md

SYNTAX
    Write-VstsUploadBuildLog [-Path] <String> [-AsOutput] [<CommonParameters>]

Write-VstsUploadFile

table of contents | full

NAME
    Write-VstsUploadFile

SYNOPSIS
    See https://github.com/Microsoft/vsts-tasks/blob/master/docs/authoring/commands.md

SYNTAX
    Write-VstsUploadFile [-Path] <String> [-AsOutput] [<CommonParameters>]

Write-VstsUploadSummary

table of contents | full

NAME
    Write-VstsUploadSummary

SYNOPSIS
    See https://github.com/Microsoft/vsts-tasks/blob/master/docs/authoring/commands.md

SYNTAX
    Write-VstsUploadSummary [-Path] <String> [-AsOutput] [<CommonParameters>]

Server OM

Get-VstsAssemblyReference

table of contents | full

NAME
    Get-VstsAssemblyReference

SYNOPSIS
    Gets assembly reference information.

SYNTAX
    Get-VstsAssemblyReference [-LiteralPath] <String> [<CommonParameters>]

DESCRIPTION
    Not supported for use during task execution. This function is only intended to help developers resolve
    the minimal set of DLLs that need to be bundled when consuming the VSTS REST SDK or TFS Extended Client
    SDK. The interface and output may change between patch releases of the VSTS Task SDK.

    Only a subset of the referenced assemblies may actually be required, depending on the functionality used
    by your task. It is best to bundle only the DLLs required for your scenario.

    Walks an assembly's references to determine all of it's dependencies. Also walks the references of the
    dependencies, and so on until all nested dependencies have been traversed. Dependencies are searched for
    in the directory of the specified assembly. NET Framework assemblies are omitted.

    See https://github.com/Microsoft/azure-pipelines-task-lib/tree/master/powershell/Docs/UsingOM.md for reliable usage
    when working with the TFS extended client SDK from a task.

Get-VstsClientCertificate

table of contents | full

NAME
    Get-VstsClientCertificate

SYNOPSIS
    Gets a client certificate for current connected TFS instance

SYNTAX
    Get-VstsClientCertificate [<CommonParameters>]

DESCRIPTION
    Gets an instance of a X509Certificate2 that is the client certificate Build/Release agent used.

Get-VstsTfsClientCredentials

table of contents | full

NAME
    Get-VstsTfsClientCredentials

SYNOPSIS
    Gets a credentials object that can be used with the TFS extended client SDK.

SYNTAX
    Get-VstsTfsClientCredentials [[-OMDirectory] <String>] [<CommonParameters>]

DESCRIPTION
    The agent job token is used to construct the credentials object. The identity associated with the token
    depends on the scope selected in the build/release definition (either the project collection
    build/release service identity, or the project build/release service identity).

    Refer to Get-VstsTfsService for a more simple to get a TFS service object.

    *** DO NOT USE Agent.ServerOMDirectory *** See
    https://github.com/Microsoft/azure-pipelines-task-lib/tree/master/powershell/Docs/UsingOM.md for reliable usage when
    working with the TFS extended client SDK from a task.

Get-VstsTfsService

table of contents | full

NAME
    Get-VstsTfsService

SYNOPSIS
    Gets a TFS extended client service.

SYNTAX
    Get-VstsTfsService [-TypeName] <String> [[-OMDirectory] <String>] [[-Uri] <String>]
    [[-TfsClientCredentials] <Object>] [<CommonParameters>]

DESCRIPTION
    Gets an instance of an ITfsTeamProjectCollectionObject.

    *** DO NOT USE Agent.ServerOMDirectory *** See
    https://github.com/Microsoft/azure-pipelines-task-lib/tree/master/powershell/Docs/UsingOM.md for reliable usage when
    working with the TFS extended client SDK from a task.

Get-VstsVssCredentials

table of contents | full

NAME
    Get-VstsVssCredentials

SYNOPSIS
    Gets a credentials object that can be used with the VSTS REST SDK.

SYNTAX
    Get-VstsVssCredentials [[-OMDirectory] <String>] [<CommonParameters>]

DESCRIPTION
    The agent job token is used to construct the credentials object. The identity associated with the token
    depends on the scope selected in the build/release definition (either the project collection
    build/release service identity, or the project service build/release identity).

    Refer to Get-VstsVssHttpClient for a more simple to get a VSS HTTP client.

    *** DO NOT USE Agent.ServerOMDirectory *** See
    https://github.com/Microsoft/azure-pipelines-task-lib/tree/master/powershell/Docs/UsingOM.md for reliable usage when
    working with the VSTS REST SDK from a task.

Get-VstsVssHttpClient

table of contents | full

NAME
    Get-VstsVssHttpClient

SYNOPSIS
    Gets a VSS HTTP client.

SYNTAX
    Get-VstsVssHttpClient [-TypeName] <String> [[-OMDirectory] <String>] [[-Uri] <String>] [[-VssCredentials]
    <Object>] [[-WebProxy] <Object>] [[-ClientCert] <Object>] [-IgnoreSslError] [<CommonParameters>]

DESCRIPTION
    Gets an instance of an VSS HTTP client.

    *** DO NOT USE Agent.ServerOMDirectory *** See
    https://github.com/Microsoft/azure-pipelines-task-lib/tree/master/powershell/Docs/UsingOM.md for reliable usage when
    working with the VSTS REST SDK from a task.

Get-VstsWebProxy

table of contents | full

NAME
    Get-VstsWebProxy

SYNOPSIS
    Gets a VstsTaskSdk.VstsWebProxy

SYNTAX
    Get-VstsWebProxy [<CommonParameters>]

DESCRIPTION
    Gets an instance of a VstsTaskSdk.VstsWebProxy that has same proxy configuration as Build/Release agent.

    VstsTaskSdk.VstsWebProxy implement System.Net.IWebProxy interface.

Tool

Assert-VstsAgent

table of contents | full

NAME
    Assert-VstsAgent

SYNOPSIS
    Asserts the agent version is at least the specified minimum.

SYNTAX
    Assert-VstsAgent [-Minimum] <Version> [<CommonParameters>]

Assert-VstsPath

table of contents | full

NAME
    Assert-VstsPath

SYNOPSIS
    Asserts that a path exists. Throws if the path does not exist.

SYNTAX
    Assert-VstsPath [-LiteralPath] <String> [[-PathType] {Any | Container | Leaf}] [-PassThru]
    [<CommonParameters>]

Invoke-VstsTool

table of contents | full

NAME
    Invoke-VstsTool

SYNOPSIS
    Executes an external program.

SYNTAX
    Invoke-VstsTool [-FileName] <String> [[-Arguments] <String>] [[-WorkingDirectory] <String>] [[-Encoding]
    <Encoding>] [-RequireExitCodeZero] [<CommonParameters>]

DESCRIPTION
    Executes an external program and waits for the process to exit.

    After calling this command, the exit code of the process can be retrieved from the variable $LASTEXITCODE.

Trace

Trace-VstsEnteringInvocation

table of contents | full

NAME
    Trace-VstsEnteringInvocation

SYNOPSIS
    Writes verbose information about the invocation being entered.

SYNTAX
    Trace-VstsEnteringInvocation [-InvocationInfo] <InvocationInfo> [[-Parameter] <String[]>]
    [<CommonParameters>]

DESCRIPTION
    Used to trace verbose information when entering a function/script. Writes an entering message followed by
    a short description of the invocation. Additionally each bound parameter and unbound argument is also
    traced.

Trace-VstsLeavingInvocation

table of contents | full

NAME
    Trace-VstsLeavingInvocation

SYNOPSIS
    Writes verbose information about the invocation being left.

SYNTAX
    Trace-VstsLeavingInvocation [-InvocationInfo] <InvocationInfo> [<CommonParameters>]

DESCRIPTION
    Used to trace verbose information when leaving a function/script. Writes a leaving message followed by a
    short description of the invocation.

Trace-VstsPath

table of contents | full

NAME
    Trace-VstsPath

SYNOPSIS
    Writes verbose information about paths.

SYNTAX
    Trace-VstsPath [[-Path] <String[]>] [-PassThru] [<CommonParameters>]

DESCRIPTION
    Writes verbose information about the paths. The paths are sorted and a the common root is written only
    once, followed by each relative path.
You can’t perform that action at this time.