ポストビルドスクリプトでTFSビルドでいくつかのawsコマンドレットコマンドを実行しようとしています。ビルドコントローラにAWS SDKツールがインストールされています。ビルドコントローラで同じコマンドを手動で実行することができます。しかし、私はTFSビルドスクリプトでそれらのコマンドを呼び出すとき。ビルドコントローラにインストールされたコマンドレットを見つけることができないというエラーが表示されます。私は実行ポリシーを変更しようとしましたが、助けにはなりませんでした。私は実行ポリシーを持っています - 今すぐバイパスしてください。スクリプトは実行中ですが、コマンドだけが実行できません。実行ポリシーなどの理由で問題だと思っています。 Power Shellからサードパーティのコマンドレットを呼び出している間は、実行ポリシーと同じように何かをチェックする必要がありますか?TFSでAWS Powershellツールコマンドレットを実行できません。ポストビルドスクリプト
コマンド:
Set-AWSCredentials -AccessKey -SecretKey
Set-DefaultAWSRegion -Region us-east-1
Write-S3Object -BucketName agero-source-package -File "\\b tfadfa\adfa\adf\asdf\adsf\asdf\asd\xyz.zip"
がエラー:エラーメッセージから
Set-DefaultAWSRegion : The term 'Set-DefaultAWSRegion' is not recognized as the name of a cmdlet, function, script
file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
and try again.
At \\b-tfsbc001wv\c$\MV\BuildETA-API.ps1:41 char:26
+ cd "\\b-tfsbc001wv\C$" | Set-DefaultAWSRegion -Region us-east-1
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Set-DefaultAWSRegion:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Write-S3Object : The term 'Write-S3Object' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At \\b-tfsbc001wv\c$\MV\BuildETA-API.ps1:43 char:26
+ cd "\\b-tfsbc001wv\c$" | Write-S3Object -BucketName agero-source-package -File " ...
+ ~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Write-S3Object:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
使用しているTFSのバージョンは? PowerShellスクリプトはビルドエージェントマシン上でコマンドを実行していますか?つまり、ビルドエージェント(コントローラではない)マシンにログオンして、手動でスクリプトを実行して結果を確認してください。 –