I feel like doing something stupid, but here is the problem:
Function getPropertyOfFile($a, $b, $c) { $a.GetDetailsOf($b, $c) }
If I pass the variables $ a, $ b, $ c corresponding to this function, this does not mean that
"Method error because [System.Object []] does not contain a method named" GetDetailsOf ".
However, if I directly replace $ a, $ b, $ c with the arguments I passed, and then try to run them, it works fine.
What's happening?
Note. I am using powershell ISE and injecting a function into powershell by copying / pasting it into the console. I also worked on the assumption that if I introduce a new function with the same name, it will be overwritten. Is there a better way to just read PS from .ps1?
Edit: I am trying to transfer the answer to this question in a function.
Edit 2:
Function getPropertyOfFile $a $b $c { $a.GetDetailsOf($b, $c) }
Gives the error Missing function body in function declaration. At line:1 char:28 Missing function body in function declaration. At line:1 char:28 .
soandos
source share