Search notes:

SQL*Plus/Powershell: Color error messages when running a script

When running an SQL script with start or @ from a PowerShell command line, the following pipeline will color lines that start with ORA- in red:
PS P:\ath\to\script> sqlplus rene@ora19 @install.sql | foreach-object { $line = $_; if ($line -match '^ORA-'){$line = "$([char]27)[38;5;9m$line$([char]27)[0m"}; $line }

See also

PowerShell: Coloring the output of a command
PowerShell: ANSI colors

Index