user18209625
user18209625

Reputation: 199

Powershell: Start-Process with an argument

I want to start a setup.exe with one install parameter => /download example.xml

When I tpye in "C:\Temp\folder\setup.exe /download example.xml" in Windows Explorer Address Bar the setup.exe starts correctly.

How do I do that with Powershell?

I've tried the following:

$setup="C:\Temp\folder\setup.exe "
$Argument = "/download example.xml"

Start-Process $setup -ArgumentList $Argument

What am I doing wrong?

Thanks!

Upvotes: 0

Views: 5514

Answers (1)

Neil Gatenby
Neil Gatenby

Reputation: 453

I think it wants a list of arguments. This might do the job

$setup="C:\Temp\folder\setup.exe "
$ArgumentLst = @("/download example.xml")

Start-Process $setup -ArgumentList $ArgumentLst

Upvotes: 2

Related Questions