3

TFS ビルドを使用して、ビルド後のスクリプトでいくつかの aws コマンドレット コマンドを実行しようとしています。ビルド コントローラーに AWS SDK ツールがインストールされています。ビルド コントローラーで同じコマンドを手動で実行できます。しかし、TFSポストビルドスクリプトでこれらのコマンドを呼び出すと. ビルド コントローラーにインストールされているコマンドレットが見つからないというエラーが表示されます。実行ポリシーを変更しようとしましたが、役に立ちませんでした。実行ポリシーがあります - 今すぐバイパスします。スクリプトは実行されていますが、コマンドだけが実行できません。実行ポリシーなどの問題だと思います。パワー シェルからサード パーティのコマンドレットを呼び出すときに、実行ポリシーなどと同じものを確認する必要がありますか。

コマンド:

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
4

3 に答える 3