Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
You can not use using namespace syntax until v5.0
#Version under 5.0
function Main
{
[OutputType([System.Collections.Generic.List[string]])]
[CmdletBinding()]
param()
$listInt = New-Object System.Collections.Generic.List[int];
$listString = New-Object System.Collections.Generic.List[string];
[System.Linq.Enumerable]::Range(0, 10) | %{ $listInt.Add($_); }
$listInt | % { $listString.Add("Item : $_"); }
return $listString;
}
Main;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.