`Invoke-SqlCmd` does not display RAISERROR messages where `sqlcmd` does I switched from sqlcmd to Invoke-SqlCmd, and suddenly my RAISERROR messages disappeared. When I run it with sqlcmd, they appear. Is there any way to make them visible with Invoke-SqlCmd?
RAISERROR (N'Hello World',0,1) WITH NOWAIT;

Invoke-SqlCmd -Server $env:MSSQL_SERVERNAME -Username $env:MSSQL_USERNAME -Password $env:MSSQL_PASSWORD -Database &quot;mydatabase&quot; -Query &quot;EXEC dbo.myprocedure&quot; -OutputSqlErrors $true;

/opt/mssql-tools/bin/sqlcmd -S $env:MSSQL_SERVERNAME -U $env:MSSQL_USERNAME -P $env:MSSQL_PASSWORD -d mydatabase -Q &quot;EXEC dbo.myprocedure&quot;;
According to the documentation for Invoke-Sqlcmd, you can use -verbose to display the output messages.  From that post:
Example 5: Run a query and display verbose output
PS C:\&gt; Set-Location &quot;SQLSERVER:\SQL\MyComputer\MainInstance&quot;
PS C:\&gt; Invoke-SqlCmd -Query &quot;PRINT N'abc'&quot; -Verbose
VERBOSE: abc

I have bat file processes that use this technique and pipe the output of the messages to a file.  Example:
-Verbose 4&gt;&amp;1&gt; 'C:\AperioSync\SyncOutput.txt'&quot;