$users = get-content iam-users.txt
$report = @()
foreach ($user in $users)
{$info = Get-IAMGroupForUser -UserName $user | select -ExpandProperty GroupName$report+="$user, $info"}$report | Out-File "user-groups.csv"
$users = get-content iam-users.txt
$report = @()
foreach ($user in $users)
{$info = Get-IAMGroupForUser -UserName $user | select -ExpandProperty GroupName$report+="$user, $info"}$report | Out-File "user-groups.csv"