0

我有一个带有参数的应用程序,但我没有尝试从 Powershell 运行的源代码。我可以让它运行,但它很快关闭并且没有任何反应。我认为它出错了,因为我拥有的文件路径是伪造的。如何保持打开状态以查看错误?

$*folder= ''
$title = "Organization"
$message = "Which Organization are you source controlling?"

$yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Donaldson", "Donaldson"

$no = New-Object System.Management.Automation.Host.ChoiceDescription "&US", "US."

$options = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no)

$result = $host.ui.PromptForChoice($title, $message, $options, 0) 

switch ($result)
    {
        0 {$args = $action -and  "/zipfile:`"\\nasprod\prod$\dciprod\mscrm\customizations\Release\Global.zip`" /folder:`"C:\Users\mchaffee\Documents\Code\CRM\Global`"" }
        1 {$args = $action -and "/zipfile:`"\\nasprod\prod$\dciprod\mscrm\customizations\Release\US.zip`" /folder:`"C:\Users\mchaffee\Documents\Code\CRM\US`"" }
    }

Start-Process  "C:\Users\mchaffee\Documents\sdk\bin\solutionpackager.exe" $args* 
4

1 回答 1

0

查看有关启动过程的帮助 - http://technet.microsoft.com/library/hh849848.aspx。它有 -wait 开关。如果这对您有用,请尝试一下。

PS C:\> start-process notepad -wait 
于 2013-08-26T17:22:05.897 回答