4
Powershellビルドステップを使用していて、ファイルを生成してそれをアーティファクトに含める必要があります。ここで私が試したことはありますが、表示されません:Teamcity - Powershellからアーティファクトを生成する
param(
[parameter(Mandatory=$true)] [string]$controller
)
Write-Output "Controller: $controller"
$testsettingsXML = @"
<?xml version="1.0" encoding="UTF-8"?>
<TestSettings name="Remote" id="36b029f0-1e34-4c17-b7b1-3e6a0284a08e" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<Description>These are default test settings for a local test run.</Description>
<RemoteController name="$controller" />
<Execution location="Remote">
<TestTypeSpecific>
<UnitTestRunConfig testTypeId="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b">
<AssemblyResolution>
<TestDirectory useLoadContext="true" />
</AssemblyResolution>
</UnitTestRunConfig>
</TestTypeSpecific>
<AgentRule name="AllAgentsDefaultRole">
</AgentRule>
</Execution>
<Properties />
</TestSettings>
"@
#write the testsettings file out to disk.
$testsettingsXML | Out-File -FilePath "./remotehack.testsettings" -Encoding utf8
私はmetarunnerで同様のことをやって、うまくいきました。なぜここにいないの?
set-locationなしで予想される場所でpsスクリプトが実行されない可能性があります。テスト実行のために-FilePathの完全なパスを作成し、そのファイルが表示されるかどうかを確認するとどうなりますか? –
同じユーザーの同じエージェントでこのスクリプトを手動で呼び出そうとしましたか?それは正常に実行されますか? –