Can the Invoke-Item cmdlet launch an executable with parameters?

Question:

I’m trying to install some custom Windows services using PowerShell, and I’ve been unable to run InstallUtil without getting the following error:

A positional parameter cannot be found that accepts argument ”

Here’s what I’ve run that causes the error above:

Answer:

From the docs:

The Invoke-Item cmdlet performs the default action on the specified item.

I don’t believe commandline arguments can be used with a default action.

However…

In this example, invoke-item shouldn’t be necessary to invoke the executable.

Source:

Can the Invoke-Item cmdlet launch an executable with parameters? by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply