|
Re: insert object in pipe Hi William
> In a filter, is is possible to insert a new object in the pipeline?
Yes, that's possible. Depending of what's your goal you could place yor
new object in the begin section.
filter myfilter
{
begin
{
$firstcall=$true
}
process
{
if($firstcall)
{
$firstcall=$false
# On first call, insert an object in pipe here.
get-date
# uncomment next line to insert the current
# pipline object, too
# $_
}
else
{
# else, process each object normally.
$_
}
}
end
{
# The end
}
}
hth
Max |