控制台窗口关闭

时间:2013-08-26 16:08:15

标签: powershell console cmd

我有一个带有参数的应用程序,我没有源代码,我尝试从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* 

1 个答案:

答案 0 :(得分:0)

查看有关启动过程的此帮助 - http://technet.microsoft.com/library/hh849848.aspx。它有-wait开关。尝试一下,如果它适合你。

PS C:\> start-process notepad -wait