containsAll

Compares the elements within one list variable with another list variable, and returns true if all elements are present.

Syntax:

$[ScriptVariable]::containsAll(List c)

Parameters:

c (List): the collection of elements to compare with the list variable.

Example:

The following example illustrates the syntax for the containsAll() list method (using the $recipients list variable created in the add example):

$buildingFourteen = "Building 14"

$buildingFourteen::add("Winston Smythe")

$confirm = $recipients::containsAll($buildingFourteen)

print($confirm)

Output:

true