System.Windows.Forms.ListView in powershell hide output System.Windows.Forms.ListView in powershell hide output powershell powershell

System.Windows.Forms.ListView in powershell hide output


To suppress the output you can use out-null:

$listView.Columns.Add('User Name')|out-null

Also if you assign it to a variable, it suppresses the output:

$item = $listView.Columns.Add('User Name')


Using [void] before any .Add method usually suppresses output:

[void]$listView.Columns.Add('User Name')