Internet Explorer is no longer supported. Many things will still work, but your experience will be degraded and some things won't function. Please use a modern browser such as Edge, Chrome, or Firefox.

Applications

  • $ApplicationDescription([appName]) - description of the current or specified application

    $ApplicationDescription

    description of the current or specified application

    Script usage:

    $ApplicationDescription([appName])

    Parameters:

    NameDescription
    appNameApplication Name
  • $ApplicationExists(Name, [IncludeInactive]) - Returns true if the application with the specified name exists, optionally including inactive applications.

    $ApplicationExists

    Returns true if the application with the specified name exists, optionally including inactive applications.

    Script usage:

    $ApplicationExists(Name, [IncludeInactive])

    Parameters:

    NameDescription
    NameThe name of the application to look for.
    IncludeInactiveWhen false, this function will return false if the specified application exists but is inactive; otherwise, it will return true for inactive applications as well. The default value is false.
  • $ApplicationGroupName - name of the current application group

    $ApplicationGroupName

    name of the current application group

    Script usage:

    $ApplicationGroupName
  • $ApplicationId - ID of the current application

    $ApplicationId

    ID of the current application

    Script usage:

    $ApplicationId
  • $ApplicationName - name of the current application

    $ApplicationName

    name of the current application

    Script usage:

    $ApplicationName
  • @ApplicationsInGroup(groupName) - list of applications which belong to the specified application group

    @ApplicationsInGroup

    list of applications which belong to the specified application group

    Script usage:

    @ApplicationsInGroup(groupName)

    Parameters:

    NameDescription
    groupNameApplication Group Name
  • @ReleasesInApplication([ApplicationName], [Status]) - Gets a list of release numbers in an application, optionally filtered by status.

    @ReleasesInApplication

    Gets a list of release numbers in an application, optionally filtered by status.

    Script usage:

    @ReleasesInApplication([ApplicationName], [Status])

    Parameters:

    NameDescription
    ApplicationNameApplication Name
    Statusactive, deployed, cancelled, or any.

Builds

  • $ArtifactPath(ArtifactName, [buildNumber], [releaseNumber], [applicationName]) - gets the path within the internal disk store for the specified artifact

    $ArtifactPath

    gets the path within the internal disk store for the specified artifact

    Script usage:

    $ArtifactPath(ArtifactName, [buildNumber], [releaseNumber], [applicationName])

    Parameters:

    NameDescription
    ArtifactNameartifactName
    buildNumberBuild Number
    releaseNumberRelease Number
    applicationNameApplication Name
  • @ArtifactsInBuild([buildNumber], [releaseNumber], [applicationName]) - list of all the artifacts in the current or specified build

    @ArtifactsInBuild

    list of all the artifacts in the current or specified build

    Script usage:

    @ArtifactsInBuild([buildNumber], [releaseNumber], [applicationName])

    Parameters:

    NameDescription
    buildNumberBuild Number
    releaseNumberRelease Number
    applicationNameApplication Name
  • $Branch([BuildNumber], [ReleaseNumber], [ApplicationName]) - Git branch for the current or specified build

    $Branch

    Git branch for the current or specified build

    Script usage:

    $Branch([BuildNumber], [ReleaseNumber], [ApplicationName])

    Parameters:

    NameDescription
    BuildNumberBuild Number
    ReleaseNumberRelease Number
    ApplicationNameApplication Name
  • $BuildMasterId(Page, [ApplicationName], [ReleaseNumber], [BuildNumber]) - Gets the internal ID of the specified page.

    $BuildMasterId

    Gets the internal ID of the specified page.

    Script usage:

    $BuildMasterId(Page, [ApplicationName], [ReleaseNumber], [BuildNumber])

    Parameters:

    NameDescription
    PageMust be "application", "release", or "build".
    ApplicationNameApplication Name
    ReleaseNumberRelease Number
    BuildNumberBuild Number
  • $BuildMasterUrl(Page, [ApplicationName], [ReleaseNumber], [BuildNumber]) - Gets the URL of the specified page.

    $BuildMasterUrl

    Gets the URL of the specified page.

    Script usage:

    $BuildMasterUrl(Page, [ApplicationName], [ReleaseNumber], [BuildNumber])

    Parameters:

    NameDescription
    PageMust be "application", "release", or "build".
    ApplicationNameApplication Name
    ReleaseNumberRelease Number
    BuildNumberBuild Number
  • $BuildNumber([releaseNum], [furthestOrLatest], [appName]) - build number of the current or specified release

    $BuildNumber

    build number of the current or specified release

    Script usage:

    $BuildNumber([releaseNum], [furthestOrLatest], [appName])

    Parameters:

    NameDescription
    releaseNumRelease Number
    furthestOrLatestMust be "furthest" or "latest"; the default is "latest".
    appNameApplication Name
  • @BuildsInRelease([ReleaseNumber], [ApplicationName], [Status], [PipelineStage]) - Gets a list of builds in a release, optionally filtered by status and pipeline stage.

    @BuildsInRelease

    Gets a list of builds in a release, optionally filtered by status and pipeline stage.

    Script usage:

    @BuildsInRelease([ReleaseNumber], [ApplicationName], [Status], [PipelineStage])

    Parameters:

    NameDescription
    ReleaseNumberRelease Number
    ApplicationNameApplication Name
    Statusactive, deployed, rejected, or any.
    PipelineStagePipeline Stage
  • BuildVariable(VariableName, [BuildNumber], [ReleaseNumber], [ApplicationName]) - Gets the value of a variable defined on a build.

    BuildVariable

    Gets the value of a variable defined on a build.

    Script usage:

    BuildVariable(VariableName, [BuildNumber], [ReleaseNumber], [ApplicationName])

    Parameters:

    NameDescription
    VariableNameVariable Name
    BuildNumberBuild Number
    ReleaseNumberRelease Number
    ApplicationNameApplication Name
  • $CIBuild([BuildNumber], [ReleaseNumber], [ApplicationName]) - Identifier of the build imported from a CI server for the current or specified BuildMaster build

    $CIBuild

    Identifier of the build imported from a CI server for the current or specified BuildMaster build

    Script usage:

    $CIBuild([BuildNumber], [ReleaseNumber], [ApplicationName])

    Parameters:

    NameDescription
    BuildNumberBuild Number
    ReleaseNumberRelease Number
    ApplicationNameApplication Name
  • $CIBuildNumber([BuildNumber], [ReleaseNumber], [ApplicationName]) - Number of the build imported from a CI server for the current or specified BuildMaster build

    $CIBuildNumber

    Number of the build imported from a CI server for the current or specified BuildMaster build

    Script usage:

    $CIBuildNumber([BuildNumber], [ReleaseNumber], [ApplicationName])

    Parameters:

    NameDescription
    BuildNumberBuild Number
    ReleaseNumberRelease Number
    ApplicationNameApplication Name
  • $CIProject([BuildNumber], [ReleaseNumber], [ApplicationName]) - Name of the CI Project resource imported from a CI server for the current or specified BuildMaster build

    $CIProject

    Name of the CI Project resource imported from a CI server for the current or specified BuildMaster build

    Script usage:

    $CIProject([BuildNumber], [ReleaseNumber], [ApplicationName])

    Parameters:

    NameDescription
    BuildNumberBuild Number
    ReleaseNumberRelease Number
    ApplicationNameApplication Name
  • $CIProjectScope([BuildNumber], [ReleaseNumber], [ApplicationName]) - Name of the CI Project scope (e.g. Jenkins Branch, TeamCity BuildConfiguration) associated with the current or specified build

    $CIProjectScope

    Name of the CI Project scope (e.g. Jenkins Branch, TeamCity BuildConfiguration) associated with the current or specified build

    Script usage:

    $CIProjectScope([BuildNumber], [ReleaseNumber], [ApplicationName])

    Parameters:

    NameDescription
    BuildNumberBuild Number
    ReleaseNumberRelease Number
    ApplicationNameApplication Name
  • $Commit([BuildNumber], [ReleaseNumber], [ApplicationName]) - Git commit hash for the current or specified build

    $Commit

    Git commit hash for the current or specified build

    Script usage:

    $Commit([BuildNumber], [ReleaseNumber], [ApplicationName])

    Parameters:

    NameDescription
    BuildNumberBuild Number
    ReleaseNumberRelease Number
    ApplicationNameApplication Name
  • $DockerRepository([BuildNumber], [ReleaseNumber], [ApplicationName]) - Docker Repository for the current or specified build

    $DockerRepository

    Docker Repository for the current or specified build

    Script usage:

    $DockerRepository([BuildNumber], [ReleaseNumber], [ApplicationName])

    Parameters:

    NameDescription
    BuildNumberBuild Number
    ReleaseNumberRelease Number
    ApplicationNameApplication Name
  • $DockerTag([BuildNumber], [ReleaseNumber], [ApplicationName]) - Most recently associated Docker tag associated with the Docker Repository on the current or specified build

    $DockerTag

    Most recently associated Docker tag associated with the Docker Repository on the current or specified build

    Script usage:

    $DockerTag([BuildNumber], [ReleaseNumber], [ApplicationName])

    Parameters:

    NameDescription
    BuildNumberBuild Number
    ReleaseNumberRelease Number
    ApplicationNameApplication Name
  • $PullRequestId([BuildNumber], [ReleaseNumber], [ApplicationName]) - Most recent pull request created for the current or specified build

    $PullRequestId

    Most recent pull request created for the current or specified build

    Script usage:

    $PullRequestId([BuildNumber], [ReleaseNumber], [ApplicationName])

    Parameters:

    NameDescription
    BuildNumberBuild Number
    ReleaseNumberRelease Number
    ApplicationNameApplication Name
  • $Repository([BuildNumber], [ReleaseNumber], [ApplicationName]) - Git repository name the current or specified build

    $Repository

    Git repository name the current or specified build

    Script usage:

    $Repository([BuildNumber], [ReleaseNumber], [ApplicationName])

    Parameters:

    NameDescription
    BuildNumberBuild Number
    ReleaseNumberRelease Number
    ApplicationNameApplication Name

Configuration Files

  • @ConfigurationFileInstances(configurationFileName, [appName]) - list configuration file instances defined for an application

    @ConfigurationFileInstances

    list configuration file instances defined for an application

    Script usage:

    @ConfigurationFileInstances(configurationFileName, [appName])

    Parameters:

    NameDescription
    configurationFileNameThe name of the configuration file.
    appNameThe name of the application.
  • @ConfigurationFiles([appName]) - list configuration files defined for an application

    @ConfigurationFiles

    list configuration files defined for an application

    Script usage:

    @ConfigurationFiles([appName])

    Parameters:

    NameDescription
    appNameThe name of the application.
  • $ConfigurationFileText(instance, [fileName], [releaseNum]) - text contents of the specified configuration file instance

    $ConfigurationFileText

    text contents of the specified configuration file instance

    Script usage:

    $ConfigurationFileText(instance, [fileName], [releaseNum])

    Parameters:

    NameDescription
    instanceThe instance name of the configuration file.
    fileNameThe name of the configuration file, or defaults to single configuration file for the contextual deployable.
    releaseNumA specific release number, or defaults to contextual release number.
  • $ConfigurationFileVersion([fileName], [releaseNum]) - version number used for deployment of the specified configuration file

    $ConfigurationFileVersion

    version number used for deployment of the specified configuration file

    Script usage:

    $ConfigurationFileVersion([fileName], [releaseNum])

    Parameters:

    NameDescription
    fileNameThe name of the configuration file, or defaults to single configuration file for the contextual deployable.
    releaseNumA specific release number, or defaults to contextual release number.

Containers

  • $ContainerDigest(repositoryName, [tag], [sourceName]) - Gets the digest of a Docker image. The digest is from the image associated with the current build.

    $ContainerDigest

    Gets the digest of a Docker image. The digest is from the image associated with the current build.

    Script usage:

    $ContainerDigest(repositoryName, [tag], [sourceName])

    Parameters:

    NameDescription
    repositoryNameRepository Name
    tagTag
    sourceNameSource Name
  • @ContainersInBuild([repositoryName]) - Gets a list of Docker images in the current build. Each returned element is a map: %(Name: SomeName, Tag: 1.2.3, Digest: sha1:3924abbeeea2162, Repository: repositoryName)

    @ContainersInBuild

    Gets a list of Docker images in the current build. Each returned element is a map: %(Name: SomeName, Tag: 1.2.3, Digest: sha1:3924abbeeea2162, Repository: repositoryName)

    Script usage:

    @ContainersInBuild([repositoryName])

    Parameters:

    NameDescription
    repositoryNameOptional name of the repository to filter by.
  • $ContainerTag(repositoryName, [sourceName]) - Gets the tag of the specified Docker image associated with the current build.

    $ContainerTag

    Gets the tag of the specified Docker image associated with the current build.

    Script usage:

    $ContainerTag(repositoryName, [sourceName])

    Parameters:

    NameDescription
    repositoryNameRepository Name
    sourceNameSource Name

Credentials

  • $SecureCredentialProperty(credential, property) - the decrypted plain text value of a specified credentials property

    $SecureCredentialProperty

    the decrypted plain text value of a specified credentials property

    Script usage:

    $SecureCredentialProperty(credential, property)

    Parameters:

    NameDescription
    credentialThe name of the credential to read.
    propertyThe name of the credential property to get. If the property is encrypted, the credential itself must be configured to allow the value to be extracted, otherwise the function call will fail at run time.

    Example:

    # HDarsUser is a Username & Password Credentials with 'Allow encrypted properties...' checked
    
    set $username = $SecureCredentialProperty(HDarsUser, Username);
    set $password = $SecureCredentialProperty(HDarsUser, Password);
    
    Log-Debug Executing sometool.exe -user $username -pass *****;
    Exec sometool.exe -user $username -pass $password;
    
  • $SecureResourceProperty(resource, property, [type]) - the value of a specified secure resource property

    $SecureResourceProperty

    the value of a specified secure resource property

    Script usage:

    $SecureResourceProperty(resource, property, [type])

    Parameters:

    NameDescription
    resourceThe name of the resource to read.
    propertyThe name of the resource property to get.
    typeThe type of the resource property to get.

    Example:

    # InternalProGet is a ProGet Secure Resource
    
    set $host = $CredentialProperty(InternalProGet, ServerUrl);
    
    exec sometool.exe --host $host;
    

Databases

  • @DatabaseConnectionsInEnvironment([environmentName]) - list of database connections for the current application which belong to the specified environment

    @DatabaseConnectionsInEnvironment

    list of database connections for the current application which belong to the specified environment

    Script usage:

    @DatabaseConnectionsInEnvironment([environmentName])

    Parameters:

    NameDescription
    environmentNameEnvironment Name

Deployables

  • @DependentApplications([appName]) - list of applications which import at least one deployable from the specified application

    @DependentApplications

    list of applications which import at least one deployable from the specified application

    Script usage:

    @DependentApplications([appName])

    Parameters:

    NameDescription
    appNameThe name of the application to return dependents for. If not specified, the application in the current context is used.
  • @DependentReleases(appName) - list of active or deployed releases from the specified application with at least one deployable imported from the current release of the current application

    @DependentReleases

    list of active or deployed releases from the specified application with at least one deployable imported from the current release of the current application

    Script usage:

    @DependentReleases(appName)

    Parameters:

    NameDescription
    appNameThe name of the application that references the current application.
  • $DeployableName([depName], [releaseNum]) - name of the current deployable in context

    $DeployableName

    name of the current deployable in context

    Script usage:

    $DeployableName([depName], [releaseNum])

    Parameters:

    NameDescription
    depNameThe application-qualified name of the deployable (e.g. AppName::DeployableName); when no application name is specified, the current application in context will be used.
    releaseNumRelease Number
  • @DeployablesInRelease([appName], [releaseNum], [includeImported]) - list of deployables included in the specified release, or the current release in context

    @DeployablesInRelease

    list of deployables included in the specified release, or the current release in context

    Script usage:

    @DeployablesInRelease([appName], [releaseNum], [includeImported])

    Parameters:

    NameDescription
    appNameThe name or ID of the application, or the current application in context if not specified.
    releaseNumThe release number, or the current release number in context if not specified.
    includeImportedA boolean indicating whether imported deployables should be included.
  • $ReferencedApplicationName([depName], [releaseNum]) - application name referenced by the current or specified deployable

    $ReferencedApplicationName

    application name referenced by the current or specified deployable

    Script usage:

    $ReferencedApplicationName([depName], [releaseNum])

    Parameters:

    NameDescription
    depNameThe application-qualified name of the deployable (e.g. AppName::DeployableName); when no application name is specified, the current application in context will be used.
    releaseNumRelease Number
  • $ReferencedPackageNumber([depName], [releaseNum], [furthestOrLatest]) - build number referenced by the current or specified deployable

    $ReferencedPackageNumber

    build number referenced by the current or specified deployable

    Script usage:

    $ReferencedPackageNumber([depName], [releaseNum], [furthestOrLatest])

    Parameters:

    NameDescription
    depNameThe application-qualified name of the deployable (e.g. AppName::DeployableName); when no application name is specified, the current application in context will be used.
    releaseNumRelease Number
    furthestOrLatestMust be "furthest" or "latest"; the default is "latest".
  • $ReferencedReleaseName([depName], [releaseNum]) - release name of the current deployable in context

    $ReferencedReleaseName

    release name of the current deployable in context

    Script usage:

    $ReferencedReleaseName([depName], [releaseNum])

    Parameters:

    NameDescription
    depNameThe application-qualified name of the deployable (e.g. AppName::DeployableName); when no application name is specified, the current application in context will be used.
    releaseNumRelease Number
  • $ReferencedReleaseNumber([depName], [releaseNum]) - release number of the current deployable in context

    $ReferencedReleaseNumber

    release number of the current deployable in context

    Script usage:

    $ReferencedReleaseNumber([depName], [releaseNum])

    Parameters:

    NameDescription
    depNameThe application-qualified name of the deployable (e.g. AppName::DeployableName); when no application name is specified, the current application in context will be used.
    releaseNumRelease Number

Environments

  • $EnvironmentName - name of the environment in context

    $EnvironmentName

    name of the environment in context

    Script usage:

    $EnvironmentName

Executions

  • $ExecutionId - Returns the current execution ID.

    $ExecutionId

    Returns the current execution ID.

    Script usage:

    $ExecutionId
  • $ExecutionState - Returns the current state of the execution (normal, warning, or error).

    $ExecutionState

    Returns the current state of the execution (normal, warning, or error).

    Script usage:

    $ExecutionState
  • $ExecutionUser - user name that initiated the current execution

    $ExecutionUser

    user name that initiated the current execution

    Script usage:

    $ExecutionUser
  • GetVariableValue(VariableName, [VariableType]) - Returns the value of a variable if the specified variable name is available in the current context; otherwise returns null.

    GetVariableValue

    Returns the value of a variable if the specified variable name is available in the current context; otherwise returns null.

    Script usage:

    GetVariableValue(VariableName, [VariableType])

    Parameters:

    NameDescription
    VariableNameThe name of the variable.
    VariableTypeMust be one of: any, scalar, vector, or map; when none is specified, "any" is used.
  • $IsReexecution - true if the current execution is a redeployment

    $IsReexecution

    true if the current execution is a redeployment

    Script usage:

    $IsReexecution
  • $IsRollback - true if a build from an earlier release is redeployed to a stage

    $IsRollback

    true if a build from an earlier release is redeployed to a stage

    Script usage:

    $IsRollback
  • $IsVariableDefined(VariableName, [VariableType]) - Returns true if the specified variable name is available in the current context; otherwise returns false.

    $IsVariableDefined

    Returns true if the specified variable name is available in the current context; otherwise returns false.

    Script usage:

    $IsVariableDefined(VariableName, [VariableType])

    Parameters:

    NameDescription
    VariableNameThe name of the variable.
    VariableTypeMust be one of: any, scalar, vector, or map; when none is specified, "any" is used.
  • $WorkingDirectory - Returns the current working directory.

    $WorkingDirectory

    Returns the current working directory.

    Script usage:

    $WorkingDirectory

Files

  • $DirectoryExists(name) - Returns "true" if the specified directory exists on the current server.

    $DirectoryExists

    Returns "true" if the specified directory exists on the current server.

    Script usage:

    $DirectoryExists(name)

    Parameters:

    NameDescription
    nameThe path of the directory.
  • $FileContents(name, [maxLength]) - Returns the contents of a file on the current server.

    $FileContents

    Returns the contents of a file on the current server.

    Script usage:

    $FileContents(name, [maxLength])

    Parameters:

    NameDescription
    nameThe path of the file.
    maxLengthThe maximum length (in characters) of the file to read.
  • $FileExists(name) - Returns "true" if the specified file exists on the current server.

    $FileExists

    Returns "true" if the specified file exists on the current server.

    Script usage:

    $FileExists(name)

    Parameters:

    NameDescription
    nameThe path of the file.
  • @FilesOnDisk(includes, [excludes], [directory]) - Returns a list of files matching the mask on the current server.

    @FilesOnDisk

    Returns a list of files matching the mask on the current server.

    Script usage:

    @FilesOnDisk(includes, [excludes], [directory])

    Parameters:

    NameDescription
    includesIncludes
    excludesExcludes
    directoryIn Directory

    Example:

    set @ProjectFiles = @FilesOnDisk(*.csproj); # gets project files in working directory
    
    set @NonXDarFiles = @FilesOnDisk(**, **.xdr, $TmpPath); # gets all files except those with an .xdr extension
    
  • $PathCombine(Path1, Path2, ...) - Returns a string containing all of the arguments combined into a complete path.

    $PathCombine

    Returns a string containing all of the arguments combined into a complete path.

    Script usage:

    $PathCombine(Path1, Path2, ...)

    Parameters:

    NameDescription
    Path1The first path element.
    Path2The second path element.
    ...Additional path elements.
  • $ResolvePath(Path) - Provides an absolute path (terminated with directory separator) based on a relative path and the current working directory; this will provide appropriate directory separators, based on the server in context

    $ResolvePath

    Provides an absolute path (terminated with directory separator) based on a relative path and the current working directory; this will provide appropriate directory separators, based on the server in context

    Script usage:

    $ResolvePath(Path)

    Parameters:

    NameDescription
    Pathpath

    Example:

    $ResolvePath(C:\MyDirectory) -> C:\MyDirectory\
    $ResolvePath() -> {WorkingDirectory}
    $ResolvePath(my\path/to/directory) -> {WorkingDirectory}/my/path/to/directory (on Linux)
    $ResolvePath(my\path/to/directory) -> {WorkingDirectory}\my\path\to\directory (on Windows)
    $ResolvePath(~\path) -> {ExecutionDirectory}\path

General

  • $AntPath - Returns the full path to ant (or ant.exe on Windows) for the server in context.

    $AntPath

    Returns the full path to ant (or ant.exe on Windows) for the server in context.

    Script usage:

    $AntPath
  • $AzPath - Returns the full path to the Azure CLI for the server in context.

    $AzPath

    Returns the full path to the Azure CLI for the server in context.

    Script usage:

    $AzPath
  • $Date([Format]) - Returns the current date and time of the local timezone in the specified .NET datetime format string, or ISO 8601 format (yyyy-MM-ddTHH:mm:ss) if no format is specified.

    $Date

    Returns the current date and time of the local timezone in the specified .NET datetime format string, or ISO 8601 format (yyyy-MM-ddTHH:mm:ss) if no format is specified.

    Script usage:

    $Date([Format])

    Parameters:

    NameDescription
    FormatAn optional .NET datetime format string.

    See also:

    Example:

    # format strings taken from https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx
    set $OtterScript = >>
    Now: $Date
    UTC Now: $DateUtc
    
    Custom: $Date(hh:mm:ss.f)
    RFC1123: $Date(r)
    Sortable: $Date(s)
    Short time: $Date(t)
    >>;
    
    set $Result = $Eval($OtterScript);
    
    Log-Information $Result;
    
  • $DateUtc([Format]) - Returns the current UTC date and time in the specified .NET datetime format string, or ISO 8601 format (yyyy-MM-ddTHH:mm:ss) if no format is specified.

    $DateUtc

    Returns the current UTC date and time in the specified .NET datetime format string, or ISO 8601 format (yyyy-MM-ddTHH:mm:ss) if no format is specified.

    Script usage:

    $DateUtc([Format])

    Parameters:

    NameDescription
    FormatAn optional .NET datetime format string.

    See also:

    Example:

    # format strings taken from https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx
    set $OtterScript = >>
    Now: $Date
    UTC Now: $DateUtc
    
    Custom: $Date(hh:mm:ss.f)
    RFC1123: $Date(r)
    Sortable: $Date(s)
    Short time: $Date(t)
    >>;
    
    set $Result = $Eval($OtterScript);
    
    Log-Information $Result;
    
  • $DevEnvPath - Full path to devenv.exe. This is usually similar to C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\devenv.exeIf no value is supplied, the operation will use vswhere to determine the path to the latest installation of Visual Studio

    $DevEnvPath

    Full path to devenv.exe. This is usually similar to C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\devenv.exeIf no value is supplied, the operation will use vswhere to determine the path to the latest installation of Visual Studio

    Script usage:

    $DevEnvPath
  • $DockerExePath - (no description

    $DockerExePath

    (none)

    Script usage:

    $DockerExePath
  • Eval(Text) - Performs variable substitution and function evaluation for arbitrary text.

    Eval

    Performs variable substitution and function evaluation for arbitrary text.

    Script usage:

    Eval(Text)

    Parameters:

    NameDescription
    TextThe text to process.

    Example:

    # format strings taken from https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx
    set $OtterScript = >>
    Now: $Date
    UTC Now: $DateUtc
    
    Custom: $Date(hh:mm:ss.f)
    RFC1123: $Date(r)
    Sortable: $Date(s)
    Short time: $Date(t)
    >>;
    
    set $Result = $Eval($OtterScript);
    
    Log-Information $Result;
    
  • $JenkinsBranchName(id) - Returns the branch portion of a multi-part buildId, or an empty string if there is no branch portion

    $JenkinsBranchName

    Returns the branch portion of a multi-part buildId, or an empty string if there is no branch portion

    Script usage:

    $JenkinsBranchName(id)

    Parameters:

    NameDescription
    idThe buildId to parse.

    Example:

    # 
    $JenkinsBranchName(my-branch-18) ==> "my-branch"
    $JenkinsBranchName ==> ""
    $JenkinsBranchName(5214) ==> ""
    $JenkinsBranchName(lastestBuild) ==> error/invalid
    
  • $JenkinsBuildNumber(id) - Returns the build number portion of a multipart buildId, or an empty string if there is no branch portion

    $JenkinsBuildNumber

    Returns the build number portion of a multipart buildId, or an empty string if there is no branch portion

    Script usage:

    $JenkinsBuildNumber(id)

    Parameters:

    NameDescription
    idThe buildId to parse.

    Example:

    # 
    $JenkinsBuildNumber(my-branch-18) ==> "18"
    $JenkinsBuildNumber ==> ""
    $JenkinsBuildNumber(5214) ==> "5214"
    $JenkinsBuildNumber(latestBuild) ==> error (invalid BuildId)
    
  • $JenkinsProjectName(resource) - The project/job name associated with a given Jenkins resource

    $JenkinsProjectName

    The project/job name associated with a given Jenkins resource

    Script usage:

    $JenkinsProjectName(resource)

    Parameters:

    NameDescription
    resourceThe name of the Jenkins resource to read.

    Example:

    # 
    $JenkinsProjectName(MyJenkinsResourceName);
    $JenkinsProjectName($CIProject);
    
  • $JenkinsUrl(resource, projectName, [buildNumber], [branchName]) - The url for the Jenkins Build

    $JenkinsUrl

    The url for the Jenkins Build

    Script usage:

    $JenkinsUrl(resource, projectName, [buildNumber], [branchName])

    Parameters:

    NameDescription
    resourceThe name of the Jenkins secure resource to read.
    projectNameThe Jenkins project name.
    buildNumberThe Jenkins build number.
    branchNameThe Jenkins branch name.

    Example:

    # 
    $JenkinsBuildUrl(MyJenkinsResource, $JenkinsJobName);
    $JenkinsBuildUrl(MyJenkinsResource, $JenkinsJobName, $JenkinsBuildNumber, $JenkinsBranchName);
    
  • $JqlValue(Value) - (no description

    $JqlValue

    (none)

    Script usage:

    $JqlValue(Value)

    Parameters:

    NameDescription
    ValueValue
  • $MavenPath - Returns the full path to mvn (or mvn.bat on Windows) for the server in context.

    $MavenPath

    Returns the full path to mvn (or mvn.bat on Windows) for the server in context.

    Script usage:

    $MavenPath
  • $MSBuildToolsPath - The directory of the MSBuild tools, typically in 'C:\Program Files (x86)\MSBuild\{ToolsVersion}\Bin'; if empty, the MSBuildToolsPath registry value under SOFTWARE\Microsoft\MSBuild\ToolsVersions will be used.

    $MSBuildToolsPath

    The directory of the MSBuild tools, typically in 'C:\Program Files (x86)\MSBuild\{ToolsVersion}\Bin'; if empty, the MSBuildToolsPath registry value under SOFTWARE\Microsoft\MSBuild\ToolsVersions will be used.

    Script usage:

    $MSBuildToolsPath
  • $PromotionComments([StageName], [BuildNumber], [ReleaseNumber], [ApplicationName]) - Returns the comments for the specified promotion, or the promotion in the current context if values are not specified.

    $PromotionComments

    Returns the comments for the specified promotion, or the promotion in the current context if values are not specified.

    Script usage:

    $PromotionComments([StageName], [BuildNumber], [ReleaseNumber], [ApplicationName])

    Parameters:

    NameDescription
    StageNameStage Name
    BuildNumberBuild Number
    ReleaseNumberRelease Number
    ApplicationNameApplication Name

    Example:

    # Stores comments from the current promotion in a variable
    set $comments = $PromotionComments;
  • @Range(Start, Count) - Returns a range of integers starting from a specified value.

    @Range

    Returns a range of integers starting from a specified value.

    Script usage:

    @Range(Start, Count)

    Parameters:

    NameDescription
    StartThe first integer of the sequence.
    CountThe number of integers to return.
  • $SpecialWindowsPath(Name) - Returns the full path of a special directory on a Windows system.

    $SpecialWindowsPath

    Returns the full path of a special directory on a Windows system.

    Script usage:

    $SpecialWindowsPath(Name)

    Parameters:

    NameDescription
    NameOne of the values of the Environment.SpecialFolder enumeration.
  • $VsTestExePath - The full path to vstest.console.exe; if empty will attempt to resolve the path automatically.

    $VsTestExePath

    The full path to vstest.console.exe; if empty will attempt to resolve the path automatically.

    Script usage:

    $VsTestExePath

JSON

  • FromJson(json) - Converts JSON to an OtterScript value.

    FromJson

    Converts JSON to an OtterScript value.

    Script usage:

    FromJson(json)

    Parameters:

    NameDescription
    jsonThe JSON data to parse.

    Example:

    %FromJson(>>{"abc":[1,2,3],"def":true}>>)
  • $JSEncode(Text) - Encodes a string for use in a JavaScript string literal.

    $JSEncode

    Encodes a string for use in a JavaScript string literal.

    Script usage:

    $JSEncode(Text)

    Parameters:

    NameDescription
    TextThe text to encode.
  • $ToJson(data) - Converts an OtterScript value to JSON.

    $ToJson

    Converts an OtterScript value to JSON.

    Script usage:

    $ToJson(data)

    Parameters:

    NameDescription
    dataThe data to encode as JSON.

    Example:

    $ToJson(%(abc: @(1, 2, 3), def: true))

Linux

  • $SHEval(ScriptText) - Returns the output of a shell script.

    $SHEval

    Returns the output of a shell script.

    Script usage:

    $SHEval(ScriptText)

    Parameters:

    NameDescription
    ScriptTextThe shell script to execute. This should be an expression.

    Example:

    # set the $NextYear variable to the value of... next year
    set $ShellScript = >>
    date -d next-year +%Y
    >>;
    set $NextYear = $SHEval($ShellScript);
    Log-Information $NextYear;
    

Lists

  • @ListConcat(...) - Creates a list containing the contents of each list in sequence.

    @ListConcat

    Creates a list containing the contents of each list in sequence.

    Script usage:

    @ListConcat(...)

    Parameters:

    NameDescription
    ...The lists to concatenate.
  • $ListCount(List) - Count the number of elements in a list.

    $ListCount

    Count the number of elements in a list.

    Script usage:

    $ListCount(List)

    Parameters:

    NameDescription
    ListThe list.
  • $ListIndexOf(List, Item) - Finds the index of an item in a list. Finding the first item in a list returns 0, and finding an item not present in the list returns -1.

    $ListIndexOf

    Finds the index of an item in a list. Finding the first item in a list returns 0, and finding an item not present in the list returns -1.

    Script usage:

    $ListIndexOf(List, Item)

    Parameters:

    NameDescription
    ListThe list.
    ItemThe item.
  • @ListInsert(List, Item, [Index]) - Inserts an item into a list.

    @ListInsert

    Inserts an item into a list.

    Script usage:

    @ListInsert(List, Item, [Index])

    Parameters:

    NameDescription
    ListThe list.
    ItemThe item.
    IndexThe index. 0 inserts the item at the start of the list. If this parameter is not present, the item is added to the end of the list.
  • ListItem(List, Index) - Gets an item from a list.

    ListItem

    Gets an item from a list.

    Script usage:

    ListItem(List, Index)

    Parameters:

    NameDescription
    ListThe list.
    IndexThe index of the item. The first item in a list is at index 0.
  • @ListRemove(List, Index) - Removes an item from a list.

    @ListRemove

    Removes an item from a list.

    Script usage:

    @ListRemove(List, Index)

    Parameters:

    NameDescription
    ListThe list.
    IndexThe index of the item to remove. The first item in a list is at index 0.

Maps

  • MapAdd(Map, Key, Value) - Adds a key-value pair to a map.

    MapAdd

    Adds a key-value pair to a map.

    Script usage:

    MapAdd(Map, Key, Value)

    Parameters:

    NameDescription
    MapThe map.
    KeyThe key to add.
    ValueThe value to add.
  • MapItem(Map, Key) - Gets an item from a map.

    MapItem

    Gets an item from a map.

    Script usage:

    MapItem(Map, Key)

    Parameters:

    NameDescription
    MapThe map.
    KeyThe key.
  • @MapKeys(Map) - Lists the keys of a map.

    @MapKeys

    Lists the keys of a map.

    Script usage:

    @MapKeys(Map)

    Parameters:

    NameDescription
    MapThe map.
  • MapRemove(Map, Key) - Removes a key from a map.

    MapRemove

    Removes a key from a map.

    Script usage:

    MapRemove(Map, Key)

    Parameters:

    NameDescription
    MapThe map.
    KeyThe key to remove.

Math

  • $Abs(value) - Returns the absolute value of a number.

    $Abs

    Returns the absolute value of a number.

    Script usage:

    $Abs(value)

    Parameters:

    NameDescription
    valueThe value to return the absolute value for.
  • $Ceiling(value) - Returns the value rounded up to the nearest integer.

    $Ceiling

    Returns the value rounded up to the nearest integer.

    Script usage:

    $Ceiling(value)

    Parameters:

    NameDescription
    valueThe value to round up.

    See also:

  • $Compare(Arg1, Operator, Arg2, [AsNumber]) - Compare two values numerically or as case-sensitive strings.

    $Compare

    Compare two values numerically or as case-sensitive strings.

    Script usage:

    $Compare(Arg1, Operator, Arg2, [AsNumber])

    Parameters:

    NameDescription
    Arg1The left-hand side of the comparison.
    OperatorOne of: <, >, <=, >=, =, !=.
    Arg2The right-hand side of the comparison.
    AsNumberOverride number detection. True causes an error if the arguments cannot be parsed as numbers. False always compares them as strings.
  • $Decrement(value, [amount]) - Returns a string that contains the result of decrementing a value.

    $Decrement

    Returns a string that contains the result of decrementing a value.

    Script usage:

    $Decrement(value, [amount])

    Parameters:

    NameDescription
    valueThe value to decrement.
    amountThe amount that will be subtracted from the value. If not specified, 1 is used.

    See also:

  • $Expr(expression) - Evaluates a mathematical expression using +, -, *, /, or % operators.

    $Expr

    Evaluates a mathematical expression using +, -, *, /, or % operators.

    Script usage:

    $Expr(expression)

    Parameters:

    NameDescription
    expressionThe expression to evaluate.
  • $Floor(value) - Returns the value rounded down to the nearest integer.

    $Floor

    Returns the value rounded down to the nearest integer.

    Script usage:

    $Floor(value)

    Parameters:

    NameDescription
    valueThe value to round down.

    See also:

  • $Increment(value, [amount]) - Returns a string that contains the result of incrementing a value.

    $Increment

    Returns a string that contains the result of incrementing a value.

    Script usage:

    $Increment(value, [amount])

    Parameters:

    NameDescription
    valueThe value to increment.
    amountThe amount that will be added to the value. If not specified, 1 is used.

    See also:

Nuget

  • $NuGetExePath - The path to the nuget.exe client. When not specified, the included nuget.exe client is used.

    $NuGetExePath

    The path to the nuget.exe client. When not specified, the included nuget.exe client is used.

    Script usage:

    $NuGetExePath

Packages

  • $PackageHash(packageName, [sourceName]) - Gets the hex-encoded SHA1 hash of a package. The hash is from the version of the package associated with the current build.

    $PackageHash

    Gets the hex-encoded SHA1 hash of a package. The hash is from the version of the package associated with the current build.

    Script usage:

    $PackageHash(packageName, [sourceName])

    Parameters:

    NameDescription
    packageNamePackage Name
    sourceNameSource Name
  • $PackageProperty(packageName, packageProperty, [sourceName]) - Gets a value from the metadata of a package. The property is from the version of the package associated with the current build.

    $PackageProperty

    Gets a value from the metadata of a package. The property is from the version of the package associated with the current build.

    Script usage:

    $PackageProperty(packageName, packageProperty, [sourceName])

    Parameters:

    NameDescription
    packageNamePackage Name
    packagePropertyPackage Property
    sourceNameSource Name
  • @PackagesInBuild([packageSource]) - Gets a list of packages in the current build. Each returned element is a map: %(Name: SomeName, Version: 1.2.3, PackageSource: SourceName)

    @PackagesInBuild

    Gets a list of packages in the current build. Each returned element is a map: %(Name: SomeName, Version: 1.2.3, PackageSource: SourceName)

    Script usage:

    @PackagesInBuild([packageSource])

    Parameters:

    NameDescription
    packageSourceOptional name of the package source to filter by.
  • $PackageVersion(packageName, [part], [sourceName]) - Gets the version of the specified package associated with the current build.

    $PackageVersion

    Gets the version of the specified package associated with the current build.

    Script usage:

    $PackageVersion(packageName, [part], [sourceName])

    Parameters:

    NameDescription
    packageNamePackage Name
    partThe version part, one of: 'full' (default), 'stable', 'pre-release', 'build'.
    sourceNameThe package source name; defaults to searching all package sources.

Pipelines

  • $PipelineName - name of the pipeline in context

    $PipelineName

    name of the pipeline in context

    Script usage:

    $PipelineName
  • $PipelineStageName - name of the pipeline stage in context

    $PipelineStageName

    name of the pipeline stage in context

    Script usage:

    $PipelineStageName

PowerShell

  • $AutoTerminatePowerShellProcess - When true, external processes created to host Windows PowerShell 5.1 scripts will be forcibly terminated after running a script to ensure resources are released. When false, processes may remain active according the PowerShell Core interop implementation.

    $AutoTerminatePowerShellProcess

    When true, external processes created to host Windows PowerShell 5.1 scripts will be forcibly terminated after running a script to ensure resources are released. When false, processes may remain active according the PowerShell Core interop implementation.

    Script usage:

    $AutoTerminatePowerShellProcess
  • $PreferWindowsPowerShell - When true, scripts will be run using Windows PowerShell 5.1 where available. When false or on Linux (or on Windows systems without PowerShell 5.1 installed), scripts will be run using PowerShell Core instead.

    $PreferWindowsPowerShell

    When true, scripts will be run using Windows PowerShell 5.1 where available. When false or on Linux (or on Windows systems without PowerShell 5.1 installed), scripts will be run using PowerShell Core instead.

    Script usage:

    $PreferWindowsPowerShell
  • $PSCredential(UserName, [Password]) - Returns a PSCredential object that can be passed to PowerShell scripts.

    $PSCredential

    Returns a PSCredential object that can be passed to PowerShell scripts.

    Script usage:

    $PSCredential(UserName, [Password])

    Parameters:

    NameDescription
    UserNameThe user name of the PSCredential object, or a UsernamePassword credential.
    PasswordThe password of the PSCredential object.

    Example:

    # convert user and password to a PSCredential object
    PSCall MyPowerShellScript
    (
        Credentials: $PSCredential(user, password)
    );
    
  • PSEval(ScriptText) - Returns the result of a PowerShell script.

    PSEval

    Returns the result of a PowerShell script.

    Script usage:

    PSEval(ScriptText)

    Parameters:

    NameDescription
    ScriptTextThe PowerShell script to execute. This should be an expression.

    Example:

    # set the $NextYear variable to the value of... next year
    set $PowershellScript = >>
    (Get-Date).year + 1
    >>;
    
    set $NextYear = $PSEval($PowershellScript);
    
    Log-Information $NextYear;

Python

  • $PythonPath - The path to python/python.exe.

    $PythonPath

    The path to python/python.exe.

    Script usage:

    $PythonPath
  • $PythonVirtualEnv - Virtual environment to use for Python and Pip operations.

    $PythonVirtualEnv

    Virtual environment to use for Python and Pip operations.

    Script usage:

    $PythonVirtualEnv

Releases

  • $CompareReleaseSequence(operator, releaseNum1, [releaseNum2]) - compares the release number of the current application with a specified release number

    $CompareReleaseSequence

    compares the release number of the current application with a specified release number

    Script usage:

    $CompareReleaseSequence(operator, releaseNum1, [releaseNum2])

    Parameters:

    NameDescription
    operatorValid operators are: ==, !=, &gt;, &lt;, &gt;=, &lt;=.
    releaseNum1Release Number1
    releaseNum2Defaults to the current release number in context when not specified.
  • $IncrementReleaseNumber(lastReleaseNumber, [releaseNumberScheme]) - Returns the next release number that would be assigned.

    $IncrementReleaseNumber

    Returns the next release number that would be assigned.

    Script usage:

    $IncrementReleaseNumber(lastReleaseNumber, [releaseNumberScheme])

    Parameters:

    NameDescription
    lastReleaseNumberThe release number to increment.
    releaseNumberSchemeMajorMinor, MajorMinorRevision, or DateBased. If not specified, uses the release number scheme of the current application.
  • $PreviousReleaseNumber([ReleaseNumber], [ApplicationName]) - release number of the last deployed release, relative to the specified or current release

    $PreviousReleaseNumber

    release number of the last deployed release, relative to the specified or current release

    Script usage:

    $PreviousReleaseNumber([ReleaseNumber], [ApplicationName])

    Parameters:

    NameDescription
    ReleaseNumberRelease Number
    ApplicationNameApplication Name
  • $ReleaseName([ReleaseNumber], [ApplicationName]) - name of the current or specified release

    $ReleaseName

    name of the current or specified release

    Script usage:

    $ReleaseName([ReleaseNumber], [ApplicationName])

    Parameters:

    NameDescription
    ReleaseNumberRelease Number
    ApplicationNameApplication Name
  • $ReleaseNumber - release number of the current release, or "0.0.0" if no release number is in context

    $ReleaseNumber

    release number of the current release, or "0.0.0" if no release number is in context

    Script usage:

    $ReleaseNumber
  • $ReleaseNumberPart(Part, [ReleaseNumber]) - a part (major, minor, build, revision) of the current or specified release number

    $ReleaseNumberPart

    a part (major, minor, build, revision) of the current or specified release number

    Script usage:

    $ReleaseNumberPart(Part, [ReleaseNumber])

    Parameters:

    NameDescription
    PartMust be "major" or "1", "minor" or "2", "build" or "3" , "revision" or "4".
    ReleaseNumberRelease Number
  • ReleaseVariable(VariableName, [ReleaseNumber], [ApplicationName]) - Gets the value of a variable defined on a release.

    ReleaseVariable

    Gets the value of a variable defined on a release.

    Script usage:

    ReleaseVariable(VariableName, [ReleaseNumber], [ApplicationName])

    Parameters:

    NameDescription
    VariableNameVariable Name
    ReleaseNumberRelease Number
    ApplicationNameApplication Name

Servers

  • @AcquiredServers(Role) - list of all of the servers acquired for a specified role

    @AcquiredServers

    list of all of the servers acquired for a specified role

    Script usage:

    @AcquiredServers(Role)

    Parameters:

    NameDescription
    RoleThe name of the server role.
  • @AllEnvironments - Returns a list of all environments.

    @AllEnvironments

    Returns a list of all environments.

    Script usage:

    @AllEnvironments

    Example:

    # log all environments in context to the execution log
    foreach $Env in @AllEnvironments
    {
        Log-Information $Env;
    }
    
  • @AllRoles - Returns a list of all server roles.

    @AllRoles

    Returns a list of all server roles.

    Script usage:

    @AllRoles

    Example:

    # log all server roles in context to the execution log
    foreach $Role in @AllRoles
    {
        Log-Information $Role;
    }
    
  • @AllServers([IncludeInactive]) - Returns a list of all servers.

    @AllServers

    Returns a list of all servers.

    Script usage:

    @AllServers([IncludeInactive])

    Parameters:

    NameDescription
    IncludeInactiveIf true, include servers marked as inactive.

    Example:

    # log all servers in context to the execution log
    foreach $Server in @AllServers
    {
        Log-Information $Server;
    }
    
  • $EnvironmentVariable(EnvironmentVariableName) - Returns the value of the specified environment variable on the current server.

    $EnvironmentVariable

    Returns the value of the specified environment variable on the current server.

    Script usage:

    $EnvironmentVariable(EnvironmentVariableName)

    Parameters:

    NameDescription
    EnvironmentVariableNameThe name of the environment variable.

    Example:

    # get the PATH on the server in context during an execution
    set $Path = $EnvironmentVariable(PATH);
    Log-Information $Path;
    
  • $RoleName - name of the current server role in context

    $RoleName

    name of the current server role in context

    Script usage:

    $RoleName
  • $ServerName - name of the current server in context

    $ServerName

    name of the current server in context

    Script usage:

    $ServerName
  • @ServersInEnvironment([EnvironmentName], [IncludeInactive]) - Returns a list of all the servers in the specified environment name.

    @ServersInEnvironment

    Returns a list of all the servers in the specified environment name.

    Script usage:

    @ServersInEnvironment([EnvironmentName], [IncludeInactive])

    Parameters:

    NameDescription
    EnvironmentNameThe name of the evironment. If not supplied, the current environment in context will be used.
    IncludeInactiveIf true, include servers marked as inactive.
  • @ServersInRole([RoleName], [IncludeInactive]) - Returns a list of servers in the specified role.

    @ServersInRole

    Returns a list of servers in the specified role.

    Script usage:

    @ServersInRole([RoleName], [IncludeInactive])

    Parameters:

    NameDescription
    RoleNameThe name of the server role. If not supplied, the current role in context will be used.
    IncludeInactiveIf true, include servers marked as inactive.
  • @ServersInRoleAndEnvironment([RoleName], [EnvironmentName], [IncludeInactive]) - Returns a list of all the servers in the specified role and environment name.

    @ServersInRoleAndEnvironment

    Returns a list of all the servers in the specified role and environment name.

    Script usage:

    @ServersInRoleAndEnvironment([RoleName], [EnvironmentName], [IncludeInactive])

    Parameters:

    NameDescription
    RoleNameThe name of the server role. If not supplied, the current role in context will be used.
    EnvironmentNameThe name of the evironment. If not supplied, the current environment in context will be used.
    IncludeInactiveIf true, include servers marked as inactive.

Strings

  • $Coalesce(...) - Returns the first argument which does not contain only whitespace.

    $Coalesce

    Returns the first argument which does not contain only whitespace.

    Script usage:

    $Coalesce(...)

    Parameters:

    NameDescription
    ...Arguments to coalesce.
  • $HtmlEncode(Text) - Encodes a string for use in HTML.

    $HtmlEncode

    Encodes a string for use in HTML.

    Script usage:

    $HtmlEncode(Text)

    Parameters:

    NameDescription
    TextThe text to encode.
  • $Join(Separator, Values) - Concatenates all elements of a list into a string using a specified separator.

    $Join

    Concatenates all elements of a list into a string using a specified separator.

    Script usage:

    $Join(Separator, Values)

    Parameters:

    NameDescription
    SeparatorThe string to use as a separator. The separator is only included if the list contains more than one element.
    ValuesThe elements to concatenate.

    See also:

  • $JSEncode(Text) - Encodes a string for use as a JavaScript literal.

    $JSEncode

    Encodes a string for use as a JavaScript literal.

    Script usage:

    $JSEncode(Text)

    Parameters:

    NameDescription
    TextText
  • $MatchesRegex(Text, RegexPattern) - Returns true when the specified text matches the specified pattern; otherwise returns false.

    $MatchesRegex

    Returns true when the specified text matches the specified pattern; otherwise returns false.

    Script usage:

    $MatchesRegex(Text, RegexPattern)

    Parameters:

    NameDescription
    TextThe text which will be evaluated by the regular expression.
    RegexPatternThe regular expression pattern.
  • $NewLine([WindowsOrLinux]) - newline string for either the operating system of the current server in context or specifically Windows or Linux

    $NewLine

    newline string for either the operating system of the current server in context or specifically Windows or Linux

    Script usage:

    $NewLine([WindowsOrLinux])

    Parameters:

    NameDescription
    WindowsOrLinuxMust be either "windows", "linux", or "current". The default value is "current" for the current server.
  • $PadLeft(Text, Length, [PadCharacter]) - Returns a new string that right-aligns the characters in this instance by padding them on the left with a specified character, for a specified total length.

    $PadLeft

    Returns a new string that right-aligns the characters in this instance by padding them on the left with a specified character, for a specified total length.

    Script usage:

    $PadLeft(Text, Length, [PadCharacter])

    Parameters:

    NameDescription
    TextThe input string.
    LengthThe length of the string to return.
    PadCharacterThe character to be inserted as padding. The default is a space.
  • $PadRight(Text, Length, [PadCharacter]) - Returns a new string that left-aligns the characters in this instance by padding them on the left with a specified character, for a specified total length.

    $PadRight

    Returns a new string that left-aligns the characters in this instance by padding them on the left with a specified character, for a specified total length.

    Script usage:

    $PadRight(Text, Length, [PadCharacter])

    Parameters:

    NameDescription
    TextThe input string.
    LengthThe length of the string to return.
    PadCharacterThe character to be inserted as padding. The default is a space.
  • @RegexFind(Text, MatchExpression, [MatchGroup]) - Finds all matches of a regular expression in a string, optionally returning only a matched group.

    @RegexFind

    Finds all matches of a regular expression in a string, optionally returning only a matched group.

    Script usage:

    @RegexFind(Text, MatchExpression, [MatchGroup])

    Parameters:

    NameDescription
    TextThe string to search for replacements.
    MatchExpressionThe regular expression used to search the first argument.
    MatchGroupWhen specified, the name or index of each match subexpression to return instead of the entire match.
  • $RegexReplace(Text, MatchExpression, ReplaceWith) - Searches for and replaces text in a string using a regular expression.

    $RegexReplace

    Searches for and replaces text in a string using a regular expression.

    Script usage:

    $RegexReplace(Text, MatchExpression, ReplaceWith)

    Parameters:

    NameDescription
    TextThe string to search for replacements.
    MatchExpressionThe regular expression used to search the first argument.
    ReplaceWithThe substring to replace occurrences of the second parameter with.
  • $Replace(Text, Value, ReplaceWith, [IgnoreCase]) - Searches for and replaces text in a string.

    $Replace

    Searches for and replaces text in a string.

    Script usage:

    $Replace(Text, Value, ReplaceWith, [IgnoreCase])

    Parameters:

    NameDescription
    TextThe string to search for replacements.
    ValueThe substring to search for in the first argument.
    ReplaceWithThe substring to replace occurrences of the second parameter with.
    IgnoreCaseWhen "true", string comparison will be performed with case insensitivity; the default is "false".
  • @Split(Text, Separator, [Count]) - Splits a string into substrings based on a specified separator.

    @Split

    Splits a string into substrings based on a specified separator.

    Script usage:

    @Split(Text, Separator, [Count])

    Parameters:

    NameDescription
    TextString to split.
    SeparatorString that delimits the substrings in this string.
    CountThe maximum number of substrings to return. If not specified, all substrings are returned.

    See also:

  • $Substring(Text, Offset, [Length]) - Returns a segment of another string.

    $Substring

    Returns a segment of another string.

    Script usage:

    $Substring(Text, Offset, [Length])

    Parameters:

    NameDescription
    TextThe input string.
    OffsetThe zero-based offset into the first parameter that will begin the segment.
    LengthThe number of characters in the segment. If not specified, the remainder of the string is used.
  • $ToLower(Text) - Returns a string with all letters converted to lowercase.

    $ToLower

    Returns a string with all letters converted to lowercase.

    Script usage:

    $ToLower(Text)

    Parameters:

    NameDescription
    TextThe string to convert to lowercase.

    See also:

  • $ToUpper(Text) - Returns a string with all letters converted to uppercase.

    $ToUpper

    Returns a string with all letters converted to uppercase.

    Script usage:

    $ToUpper(Text)

    Parameters:

    NameDescription
    TextThe string to convert to uppercase.

    See also:

  • $Trim(Text, ...) - Returns a string with all leading and trailing whitespace characters removed, or optionally a set of specified characters.

    $Trim

    Returns a string with all leading and trailing whitespace characters removed, or optionally a set of specified characters.

    Script usage:

    $Trim(Text, ...)

    Parameters:

    NameDescription
    TextThe input string.
    ...Characters to trim.
  • $TrimEnd(Text, ...) - Returns a string with all trailing whitespace characters removed, or optionally a set of specified characters.

    $TrimEnd

    Returns a string with all trailing whitespace characters removed, or optionally a set of specified characters.

    Script usage:

    $TrimEnd(Text, ...)

    Parameters:

    NameDescription
    TextThe input string.
    ...Characters to trim.
  • $TrimStart(Text, ...) - Returns a string with all leading whitespace characters removed, or optionally a set of specified characters.

    $TrimStart

    Returns a string with all leading whitespace characters removed, or optionally a set of specified characters.

    Script usage:

    $TrimStart(Text, ...)

    Parameters:

    NameDescription
    TextThe input string.
    ...Characters to trim.
  • $UrlEncode(Text) - Escapes a string for use in a URL.

    $UrlEncode

    Escapes a string for use in a URL.

    Script usage:

    $UrlEncode(Text)

    Parameters:

    NameDescription
    TextThe text to escape.

Svn

  • $SvnDefaultServerName - The name of the server to connect to when browsing from the web UI, otherwise a local agent is used

    $SvnDefaultServerName

    The name of the server to connect to when browsing from the web UI, otherwise a local agent is used

    Script usage:

    $SvnDefaultServerName
  • $SvnExePath - an overridden path to svn.exe on the server; if not supplied, the embedded svn.exe client will be used

    $SvnExePath

    an overridden path to svn.exe on the server; if not supplied, the embedded svn.exe client will be used

    Script usage:

    $SvnExePath

XML

  • $XmlEncode(Text) - Encodes a string for use in an XML element.

    $XmlEncode

    Encodes a string for use in an XML element.

    Script usage:

    $XmlEncode(Text)

    Parameters:

    NameDescription
    TextThe text to encode.