modules/teamcityExtensions/MetaRunners/PSCI_BuildWithPsci.xml

<?xml version="1.0" encoding="UTF-8"?>
<meta-runner name="PSCI: Build with PSCI">
  <description>Builds a package using PSCI</description>
  <settings>
    <parameters>
      <param name="psci.build.tasks" value="" spec="text description='Comma-delimited list of tasks to run. Leave empty for default task.' validationMode='any' label='Tasks' display='normal'" />
      <param name="psci.build.buildps1" value="" spec="text description='Path to build.ps1' validationMode='not_empty' label='Path to build.ps1' display='normal'" />
      <param name="psci.build.version" value="%build.number%" spec="text description='Version number' validationMode='any' label='Version' display='normal'" />
      <param name="psci.build.projectRootPath" value="" spec="text description='Base project directory (leave empty for default defined in build.ps1)' validationMode='any' label='Path to project root' display='normal'" />
      <param name="psci.build.psciPath" value="" spec="text description='Path to PSCI (leave empty for default defined in build.ps1, put AGENT_PSCI for PSCI available at Teamcity agent)' validationMode='any' label='Path to PSCI' display='normal'" />
      <param name="psci.build.packagesPath" value="" spec="text description='Path to packages directory (leave empty for default defined in build.ps1)' validationMode='any' label='Path to packages' display='normal'" />
    </parameters>
    <build-runners>
      <runner name="Run PSCI build" type="jetbrains_powershell">
        <parameters>
          <param name="jetbrains_powershell_bitness" value="x64" />
          <param name="jetbrains_powershell_execution" value="PS1" />
          <param name="jetbrains_powershell_script_code"><![CDATA[$params = @{}
$global:ErrorActionPreference = "Stop"
try {
if ('%psci.build.version%') {
  $params.Version = '%psci.build.version%'
}
if ('%psci.build.projectRootPath%') {
  $params.ProjectRootPath = '%psci.build.projectRootPath%'
}
if ('%psci.build.psciPath%') {
  if ('%psci.build.psciPath%' -ieq 'AGENT_PSCI') {
    $psciPath = [Environment]::GetEnvironmentVariable('PSCI_PATH', 'Machine')
  } else {
    $psciPath = '%psci.build.psciPath%'
  }

  $content = Get-Content -Path '%psci.build.buildps1%' -ReadCount 0 | Out-String
  # this is required for backward compatibility, to be removed in future
  if ($content -imatch '\$PSCILibraryPath') {
    $params.PSCILibraryPath = $psciPath
  } else {
    $params.ObjPSCILibraryPath = $psciPath
  }
}
if ('%psci.build.packagesPath%') {
  $params.PackagesPath = '%psci.build.packagesPath%'
}
if ('%psci.build.tasks%') {
  $params.Tasks = '%psci.build.tasks%' -split ','
}
if (!(Test-Path -Path '%psci.build.buildps1%')) {
  throw "Cannot find path '%psci.build.buildps1%'"
}
} catch {
  Write-Host $_ -ErrorAction SilentlyContinue
  exit 1
}

Write-Host "Running %psci.build.buildps1%"
& "%psci.build.buildps1%" @params
exit $lastexitcode]]></param>
          <param name="jetbrains_powershell_script_mode" value="CODE" />
          <param name="teamcity.step.mode" value="default" />
        </parameters>
      </runner>
    </build-runners>
    <requirements />
  </settings>
</meta-runner>