Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
華麗なるクソ回避
using namespace System.Collections.Generic;
function Hoge
{
[OutputType([List[string]])]
[CmdletBinding()]
param()
$list = New-Object List[string];
$list.Add("a");
return $list;
}
@(Hoge).GetType().FullName # System.Object[]
function Fuga
{
[OutputType([List[string]])]
[CmdletBinding()]
param()
$array = [string[]]("a")
return $array
}
@(Fuga).GetType().FullName # System.Object[]
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.