想寫師的一個簡單的功能,但我得到一個錯誤(「/」)在功能上
PS C:\Users\john> Function Div($x, $y) { $x/$y }
PS C:\Users\john> Div (1, 1)
Method invocation failed because [System.Object[]] doesn't contain a method named 'op_Division'.
At line:1 char:28
+ Function Div($x, $y) { $x/<<<< $y }
+ CategoryInfo : InvalidOperation: (op_Division:String) [], RuntimeException
+ FullyQualifiedErrorId : MethodNotFound
什麼是我的錯?謝謝
[Powershell - 多個函數參數]可能的重複(http://stackoverflow.com/questions/4988226/powershell-multiple-function-parameters) – manojlds