1

In need of some help on trying the port the following code from C# to PowerShell. Overall, it's simply a method from a customer .dll that we define a type before passing its parameters. This runs fine in C# but can't seem to get it going in PowerShell. Note that loading the .dll in PowerShell goes fine with no issues and I can access all its methods. Just can't successfully run it.

In C#, I run the method as follows:

tool.FindById<Type>("Name","Id")

In PowerShell, I've tried the following with no success:

tool.FindById("Name","Id") = This errors out with Cannot find an overload for FindById and the argument count...

[Type]tool.FindById("Name","Id") = This errors out with the same error as the first one.

tool.FindById([Type]("Name","Id")) = This errors out with Cannot convert the "System.Object[]" value of Type "System.Object[]" to Type "Type"...

Any infor on how to go about with this would be great!

0 Answers0