我有一个脚本可以完美地使用 Windows PowerShell 上传到 S3 存储桶,但它不适用于 PowerShell Core。根据亚马逊的说法,大多数在一个中工作的 cmdlet 应该在另一个中工作。
这是我正在使用的命令:
Write-S3Object -BucketName $bucketName -Folder $localDir -KeyPrefix $targetFolder -AccessKey $accessKey -SecretKey $secretKey -Recurse
同样,当我尝试直接在 PowerShell 中运行命令时,它按预期工作,但在 PowerShell Core 中出现此错误:
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 line:1 char:1
+ Write-S3Object -BucketName "cloud-storage-poc" -Folder "C:\Users\Admi ...
+ ~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Write-S3Object:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException