teamcity 経由で実行しようとしている powershell スクリプトがあります。スクリプトは、コードのビルド元の git リポジトリに保存されます。スクリプトをスクリプト ファイルとして実行するように teamcity を設定しました
ビルド サーバーで powershell コマンドラインからスクリプトを実行すると、期待どおりに実行されます。teamcity から同じスクリプトを実行すると、次のようなエラーが発生します。
[16:04:25][Step 3/3] Get-Date : Cannot bind parameter 'Date'. Cannot convert value "–f" to type
[16:04:25][Step 3/3] "System.DateTime". Error: "The string was not recognized as a valid DateTime.
[16:04:25][Step 3/3] There is an unknown word starting at index 0."
[16:04:25][Step 3/3] At line:1 char:26
[16:04:25][Step 3/3] + Write-Output "$(Get-Date –f $timeStampFormat) - Upgrading Deployment: In
[16:04:25][Step 3/3] progr ...
[16:04:25][Step 3/3] + ~~~~
[16:04:25][Step 3/3] + CategoryInfo : InvalidArgument: (:) [Get-Date], ParameterBindin
[16:04:25][Step 3/3] gException
[16:04:25][Step 3/3] + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerSh
[16:04:25][Step 3/3] ell.Commands.GetDateCommand
[16:04:25][Step 3/3]
なぜこれが起こっているのでしょうか?