In my script I run a command like
[array]$Results = $AllSpamAllowGroups.Email | ForEach-Object {
& gam update group $_ spam_moderation_level moderate
[PSCustomObject]@{
GroupEmail = $_
Error = $LastExitCode
}
}
When I open the results it is
"12"
"45"
"19"
...so on
If I
& gam update group $_ spam_moderation_level moderate | out-null
Then $Results
has good data. But the command doesn't actually do anything.
Do I have to assign it to a trash Variable ?
$IAMTrash = & gam update group $_ spam_moderation_level moderate
Seems like I should not have to do this. (Trash variable also gives good data)