2
votes

I am trying to run the process and wait until it is closed. When I run VSIXInstaller like below it works:

$pathToTheExtension = $path + "VS2012.Ext.vsix"
VSIXInstaller.exe $pathToTheExtension

But when I run it through the Start-Process VSIXInstaller does not get $pathToTheExtension as an argument.

$pathToTheExtension = $path + "VS2012.Ext.vsix"
$result = $(Start-Process -filePath "VSIXInstaller.exe" -argumentList $pathToTheExtension -Wait)

How should I pass the path to the vsix file through the Start-Process?

Below is the result of running Start-Process.

enter image description here

EDIT

I check command line parameter for the running VSIXInstaller process from the Process explorer and it seems correct for me.

"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\VSIXInstaller.exe" "C:\VS2012.Ext.vsix"
1

1 Answers

4
votes

You need to surround the argument value with quotes.

$pathToTheExtension = '"{0}VS2012.Ext.vsix"' -f $path;
$result = Start-Process -FilePath "VSIXInstaller.exe" -ArgumentList $pathToTheExtension -Wait -PassThru;