这件事一直困扰着我,几周前我想出了一个解决办法,但我忘了:
$l=[System.Collections.Generic.List[string[]]]::new()
$l.Add("one", "two", "three")
$l.ToString() #returns ---> System.String[]
"$l" #returns ---> System.String[]
[string]$l #returns ---> System.String[]
$l -join "`n" #returns ---> System.String[]
我期望类似以下内容或由$ofs
变量指定的其他内容:
one
two
three
我在 pwsh 7.4