I want to user powershell to exec the command and get the execute result
let's say i want to use msival2.exe to certificate the msi installation package, and the exe will give me the information DURING the certification process..
I use Invoke-Expression
and like that...
$out_put = Invoke-Expression ".\msival2.exe $msiPackageName darice.cub"
I could get the result from $out_put, ONLY AFTER the certification....
How could I get the result DURING the process of command just like I run the msival2.exe manually...
Thanks
如果你想收集msival2.exe
的输出并同时看到屏幕上显示的输出,我建议使用call运算符&
,并使用Tee-Object
将输出复制到变量:
& .\msival2.exe $msiPackageName darice.cub |Tee-Object -Variable out_path
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.