首页 > 解决方案 > 如何将Powershell中SQL存储过程返回的消息返回到记事本

问题描述

我必须从 Powershell 运行一个存储过程,并且我能够做到。存储过程不返回任何内容,但会在 Messages 部分打印一些值(请参见下文)

结果|留言

我需要在 powershell 的记事本中输出消息下返回的这个值。下面是我试过但不起作用的代码。请帮忙。

    $out1 = $command.ExecuteReader();
    $out1.Read()
    $out2=$out1[1]
    $out2 | Out-File $outFile -Append

标签: mysqlsqlpowershell

解决方案


推荐阅读