looking for some solutions? You are welcome.

SOLVED: How to pass optional arguments to object method using PowerShell?

OrangeSpider:

I would like to call the method of an object. This method has many optional parameters but I would like to use only one. How can I do that in PowerShell ?

Example: Object Workbooks has method OpenText (link) which has many optional parameters but I would like to pass only the value for parameter DecimalSeparator, all others I don't want to specify.

In other languages I would do something like this:

$App.Workbooks.OpenText($path, DecimalSeparator=$decSeparator)

Please, tell me how to do that in PowerShell ?



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
Share:

No comments:

Recent