【发布时间】:2018-01-09 13:54:53
【问题描述】:
所以我在$var 中存储了以下 ArrayList:
我需要为此添加一行,但是以下代码返回错误:
$var.add("127.0.0.1/32", "GLOBAL", "something")
错误:
找不到“添加”和参数计数的重载:“3”。 在行:1 字符:1 + $awsips.add("127.0.0.1/32", "全球", "某事") + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~ + CategoryInfo : NotSpecified: (:) [], MethodException + FullyQualifiedErrorId : MethodCountCouldNotFindBest我确信我必须调整一些简单的东西,但是 Google 搜索让我绕圈子。
【问题讨论】:
-
您好。看看这里。 stackoverflow.com/questions/11266013/…。看起来您正在添加到对象数组中。所以你需要在添加时设置新对象的属性
标签: arrays windows powershell arraylist