I am trying to write a PowerShell script, and I am declaring a variable, al
as an ArrayList
. However when I execute the script, I get the following output.
4
Now I have figured out which output is being caused by which variable. However, I can't find how to suppress the variables to suppress the output, so only my logs print without the extra clutter. How can I write the two lines to suppress the output?
Note: I will be adding more elements to the array to declaring $al
with @()
doesn't work in my code.
$al = [System.Collections.ArrayList]@($v1, $v2, $v3, $v4)
Edit: Removed references to XML because the cause of the print was an echo statement I forgot about.