This simple Powershell Script (AWS modules) will get output a list of Polices Per Group (1 or multiple policies per Group). As you can see I loop through the Groups and can get the output. Using "Write-output" I can get a text "report" but I can't figure out how to send the output to something, assuming a variable/hashtable so that I can send it to Convertto-HTML or CVS
$Groups=(Get-IAmGroupList).GroupName
ForEach ($item in $Groups) {
(Get-IAMAttachedGroupPolicies -GroupName $item).PolicyName
}
Any ideas? I've looked so many places but its all so confusing to me and I'm not a powershell guy (this is an automation thing I'm trying to do for myself.
Write-Output? UseConvertto-Htmlthe same way. - vrdseForEachto a variable.$PolicyNames = ForEach ($item in $Groups) { .... Then pipe the output toConvertto-HTMLor csv repectively - vrdse