Skip to content

Instantly share code, notes, and snippets.

View lightertu's full-sized avatar

Rui Tu lightertu

  • Computer Architecture & Embedded Systems Laboratory
  • University of Oregon
View GitHub Profile
@lightertu
lightertu / Hashset.ps1
Created March 5, 2018 08:45 — forked from midnightfreddie/Hashset.ps1
Random useless code that I want to remember for hashset and the return trick
function myfunc{
$myvar = new-object 'System.Collections.Generic.HashSet[string]'
# [void]$$myvar.add("value")
$myvar.add("value") | Out-Null
$myvar.add("value2") | Out-Null
# Write-Host $($myvar.GetType())
@(,$myvar)
}
(myfunc).GetType()
$returnedvalue = myfunc