0
我有一个书面控制台应用程序。现在我需要通过Power-Shell脚本运行该控制台应用程序,并将控制台应用程序输出的副本复制到文本文件中。我能够通过Power-shell脚本访问应用程序,但将输出复制到文本文件中失败。我是很新的这股力量,shell脚本,控制台应用程序使用PowerShell脚本输出到文本文件
我的PowerShell脚本到目前为止,我曾写过
[string]$param1
[string]$param2
[string]$exePath = "\\Visual Studio 2015\Projects\PowerShellTestApp\PowerShellTestApp\bin\Debug\PowerShellTestApp.exe"
$psi= New-Object System.Diagnostics.ProcessStartInfo $exePath
$param1 = Read-Host "Please enter your Name"
$param2 = Read-Host "Please enter your Location"
$psi.Arguments = $param1, $param2
[System.Diagnostics.Process]::Start($psi)