Wrapping calls to native commands

by Feb 18, 2011

I want to automatically wrap all calls to native programs with my CmdLet.  How can I do that?

 

Some context of what I'm trying to do. I have several scripts that call some native programs that write to stderr their valid progress. I'd like to postprocess such calls with something like that:

was:build

become:

$output = build 2>&1
$output | %{ if( $_.WriteErrorStream ) {$_.Exception.Message.Trim()} else {$_} }