As an alternative you could reroute the streams and use the standard Write-Error, Write-Verbose, etc. CMDlets in your Script.
In your C# app attach methods to the streams events, like so:
PowerShell ps = PowerShell.Create();
// ... code to add your script, etc.
ps.Streams.Warning.DataAdded += new EventHandler<DataAddedEventArgs>(Warning_DataAdded);
// ... attach more streams for other log levels
ps.Invoke();
Create your methods like so:
static void Warning_DataAdded(object sender, DataAddedEventArgs e)
{
PSDataCollection<WarningRecord> warningStream = (PSDataCollection<WarningRecord>)sender;
log.Warn(warningStream[e.Index].Message);
}
This should write everything you output in your PowerShell Script via
Write-Warning "This is a warning message"
to the Warn level in log4net.