Skip to content

Instantly share code, notes, and snippets.

@sassdawe
Created May 8, 2024 12:45
Show Gist options
  • Save sassdawe/722d34b80a97876069f8eb76fe83abd1 to your computer and use it in GitHub Desktop.
Save sassdawe/722d34b80a97876069f8eb76fe83abd1 to your computer and use it in GitHub Desktop.
HashSet is a hash-based collection that allows only distinct elements
<#
The basics: A HashSet is a collection that holds unique elements in no particular order (O(1) complexity
for adding, searching or removing). The HashSet<T> is a generic class in the System.Collections.Generic
namespace, ideal for managing large data sets and performing set operations.
Core aspects: The dotnet HashSet is a hash-based collection that allows only distinct elements.
It supports various operations such as Union, Intersection, Difference, and more.
More: https://www.bytehide.com/blog/hashset-csharp
#>
$mySet = New-Object System.Collections.Generic.HashSet[string]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment