我已经在 Powershell 2.0 中的 Win XP 和 Windows Server 2008 R2 上对此进行了测试:
$a = 1,2,3,4 # a simple [object[]] but any other Type is good
如果我做:
$a.addres()
返回错误是(正确):
Method invocation failed because [System.Object[]] doesn't contain a method named 'addres'.
但如果我这样做:
$a.address()
错误是:
Cannot find an overload for "Address" and the argument count: "0".
但是做:
$a.address(2)
关闭 powershell 控制台'Problem Event Name: APPCRASH'
从那开始[system.array]
还没有一个方法叫address
powershell怎么尝试调用一个已有的方法呢?