ps script works in AWSPowerShell.NetCore 4.1.632 but not in newer version #381
-
Hi All, Here is a redacted version of the script that runs in 4.1.632 and not in the current version: Set-AWSCredential -AccessKey -SecretKey Set parameters$endpointUrl = "https://s3.us-south.cloud-object-storage.appdomain.cloud" Import the AWS SDK for .NET (assuming the AWS PowerShell module is already installed)#Import-Module AWS.Tools.S3 #-tried using the newer ASW.Tools but it has the same error Function to log messagesfunction Log-Message { Define the folders and their associated names in S3$folderNames = @("CRAFT", "LABOR", "PERSON") Get all XML files from the root directory$xmlFiles = Get-ChildItem -Path $targetFolder -Filter "*.xml" | Select-Object -First 3
} Get .temp files from the root directory$tempFiles = Get-ChildItem -Path $targetFolder -Filter "*.temp" | Select-Object -First 3
} Delete .temp files from the S3 bucket$tempObjects = Get-S3Object -BucketName $bucketName -EndpointUrl $endpointUrl | Where-Object { $_.Key -like "*.temp" } foreach ($object in $tempObjects) { Log-Message "File transfer and cleanup completed." Any help is greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Versions Ideally, these 3rd parties should be updated to support the new default integrity protections, but for the moment you can also set the |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
Versions
4.1.737
and later of the AWS Tools for PowerShell automatically calculate request checksums for a few S3 operations (announcement in #370). This works transparently for the actual S3 service, but there are some 3rd-party implementations that do not support this feature yet (for example #371 - which mentions a similar error message).Ideally, these 3rd parties should be updated to support the new default integrity protections, but for the moment you can also set the
AWS_REQUEST_CHECKSUM_CALCULATION
option toWHEN_REQUIRED
(this documentation page has more details on the option and what it means: https://docs.aws.amazon.com/sdkref/latest/guide/feature-dataintegrity.html).