lundi 2 février 2015

Set-AWSCredentials fails on remote execution

I am using a script to initialize and set AWS account credentials using AWS Powershell tools on a remote machine and download something from S3, it works fine when I rdp to it and run it, however when I try running it remotely from invoke-command Invoke-Command -FilePath $command -Credential $credential -ComputerName $env:COMPUTERNAME , it fails. I found that when it runs remotely Set-AWSCredentials cannot create a credentials profle in - RegisteredAccounts.json in the directory C:\Users\Username\AppData\Local\AWSToolkit Instead of using a Credentials Profile, I tried passing the credentials in the command - Get-S3Object -BucketName $bucket -KeyPrefix $keyPrefix -AccessKey $accessKey -SecretKey $secretKey -Region $region , it works fine when I rdp it and actually run it, but on remote execution it cannot load the credentials from shell defaults


Aucun commentaire:

Enregistrer un commentaire