Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell 启动进程不适用于VSIXInstaller.exe_Powershell_Powershell 2.0_Vsix - Fatal编程技术网

Powershell 启动进程不适用于VSIXInstaller.exe

Powershell 启动进程不适用于VSIXInstaller.exe,powershell,powershell-2.0,vsix,Powershell,Powershell 2.0,Vsix,我正在尝试运行进程并等待它关闭。 当我像下面这样运行VSIXInstaller时,它可以工作: $pathToTheExtension = $path + "VS2012.Ext.vsix" VSIXInstaller.exe $pathToTheExtension 但是,当我在启动过程中运行它时,VSIXInstaller并没有将$pathToTheExtension作为参数 $pathToTheExtension = $path + "VS2012.Ext.vsix" $result =

我正在尝试运行进程并等待它关闭。 当我像下面这样运行VSIXInstaller时,它可以工作:

$pathToTheExtension = $path + "VS2012.Ext.vsix"
VSIXInstaller.exe $pathToTheExtension
但是,当我在启动过程中运行它时,VSIXInstaller并没有将$pathToTheExtension作为参数

$pathToTheExtension = $path + "VS2012.Ext.vsix"
$result = $(Start-Process -filePath "VSIXInstaller.exe" -argumentList $pathToTheExtension -Wait)
如何在启动过程中传递vsix文件的路径

下面是运行启动过程的结果

编辑

我从process explorer中检查正在运行的VSIXInstaller进程的命令行参数,它对我来说似乎是正确的

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

您需要用引号将参数值括起来

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

您需要用引号将参数值括起来

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

不幸的是,它会导致相同的结果$path后面有斜杠吗?如果没有,则必须在{0}之后的文件路径和文件名之间添加一个。$path有效,因为我可以使用VSIXInstaller.exe$path TOTHEXTENSIONS运行它。不幸的是,它会导致相同的结果$path后面有斜杠吗?如果没有,则必须在{0}之后的文件路径和文件名之间添加一个。$path是有效的,因为我可以使用VSIXInstaller.exe$pathToTheExtension运行它