Open BryanWilhite opened 5 years ago
ArrayList is not loaded by default?
ArrayList
@() returns an array
@()
{@()}.Invoke() returns a collection that supports Add() and Remove()
{@()}.Invoke()
Add()
Remove()
{@()}.Invoke() returned from a function is boxed/cast as array of fixed size
use <collection> | Sort-Object | Get-Unique because Get-Unique requires a sorted set
<collection> | Sort-Object | Get-Unique
Get-Unique
use <collection>.Remove(...) | Out-Null to prevent returning True
<collection>.Remove(...) | Out-Null
True
https://stackoverflow.com/questions/618618/how-to-create-an-arraylist-from-an-array-in-powershell
https://www.jonathanmedd.net/2014/01/adding-and-removing-items-from-a-powershell-array.html
ArrayList
is not loaded by default?@()
returns an array{@()}.Invoke()
returns a collection that supportsAdd()
andRemove()
{@()}.Invoke()
returned from a function is boxed/cast as array of fixed sizeuse
<collection> | Sort-Object | Get-Unique
becauseGet-Unique
requires a sorted setuse
<collection>.Remove(...) | Out-Null
to prevent returningTrue
https://stackoverflow.com/questions/618618/how-to-create-an-arraylist-from-an-array-in-powershell
https://www.jonathanmedd.net/2014/01/adding-and-removing-items-from-a-powershell-array.html