mardi 23 juin 2015

Display multiple output in csv using powershell

$s3list = Get-S3Bucket  | Select-Object BucketName, CreationDate

foreach ($item in $s3list) {
    $s3bucket = $item.bucketname
    Get-S3BucketTagging -BucketName $s3bucket
}

The above code is incorrect.

Get-S3Bucket creates two objects, they are BucketName and CreationDate.

Get-S3BucketTagging also creates two objects Key and Value.

How do I write this to display in CSV file so the output looks like: enter image description here

*Each BucketName associated with multiple keys and values.




Aucun commentaire:

Enregistrer un commentaire