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