Public/SDK Wrappers/S3/Get-VSS3ObjectMetadata.ps1
function Get-VSS3ObjectMetadata { <# .SYNOPSIS Gets an S3 object's metadata .PARAMETER BucketName The name of the bucket containing the object. .PARAMETER Key The name (including prefix, if applicable) of the object. .PARAMETER ProfileName The name of the configuration profile to deploy the stack with. Defaults to $env:AWS_PROFILE, if set. .FUNCTIONALITY Vaporshell #> [cmdletbinding()] Param ( [parameter(Mandatory = $true,Position = 0)] [String] $BucketName, [parameter(Mandatory = $true,Position = 1)] [String] $Key, [parameter(Mandatory = $false)] [String] $ProfileName = $env:AWS_PROFILE ) Process { $method = "GetObjectMetadata" $requestType = "Amazon.S3.Model.$($method)Request" $request = New-Object $requestType foreach ($key in $PSBoundParameters.Keys) { if ($request.PSObject.Properties.Name -contains $key) { $request.$key = $PSBoundParameters[$key] } } $results = ProcessRequest $PSCmdlet.ParameterSetName $ProfileName $method $request $expand if (!$results) { return } elseif ($results -is 'System.Management.Automation.ErrorRecord') { $PSCmdlet.ThrowTerminatingError($results) } elseif ($results) { return $results } } } |