[Solved] How to prevent Powershell not showing script processing data


Some .Net Methods and external programs output their exit code and other output to stdout.

You can either add the void keyword to the arraylist “Add” command or pipe it to Out-Null

$MyList = [System.Collections.ArrayList]@()
1..10 | % { $MyList.Add($_) } # outputs 0 to 9

1..10 | % { [void]$MyList.Add($_) } # no output
1..10 | % { $MyList.Add($_) | Out-Null } # no output

solved How to prevent Powershell not showing script processing data