PowerShell
PowerShell
Example: Http.S3_FileExists method
Demonstrates theS3_FileExists method.
Chilkat PowerShell Downloads
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"
$http = New-Object Chilkat.Http
# Insert your AWS keys here:
$http.AwsAccessKey = "AWS_ACCESS_KEY"
$http.AwsSecretKey = "AWS_SECRET_KEY"
$bucketName = "chilkat.ocean"
$objectName = "seahorse.jpg"
$http.AwsRegion = "us-west-2"
$http.AwsEndpoint = "s3-us-west-2.amazonaws.com"
$retval = $http.S3_FileExists($bucketName,$objectName)
if ($retval -lt 0) {
$("Failed to check for the S3 object existence")
$($http.LastErrorText)
exit
}
if ($retval -eq 0) {
$("The S3 object does not exist.")
exit
}
$("The S3 object exists.")