Skip to content

Instantly share code, notes, and snippets.

@guitarrapc
Last active August 29, 2015 23:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guitarrapc/1149232432474369647c to your computer and use it in GitHub Desktop.
Save guitarrapc/1149232432474369647c to your computer and use it in GitHub Desktop.
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