This have nothing to do with filter
being reserved word in PowerShell. The problem in how PowerShell pass parameters to native application. Your command line will be passed as:
OpenCover.Console.exe -output:Coverage.xml -register:user "-filter:"+[*]* -[*]*.Test*"" -target:nunit-console.exe "-targetargs:"Test.dll /config:Release /noshadow /nologo /labels""
Some extra quotes, added by PowerShell, cause that wrong command line will be passed to native application.
First thing you can try, is to change command line to following:
OpenCover.Console.exe -output:Coverage.xml -register:user "-filter:+[*]* -[*]*.Test*" -target:nunit-console.exe "-targetargs:Test.dll /config:Release /noshadow /nologo /labels"
In that case, no extra quotes will be added by PowerShell, and possible that OpenCover.Console.exe
can recognize your command.
If that does not help, than you could use Start-Process
cmdlet, it never add any extra qoutes:
Start-Process OpenCover.Console.exe '-output:Coverage.xml -register:user -filter:"+[*]* -[*]*.Test*" -target:nunit-console.exe -targetargs:"Test.dll /config:Release /noshadow /nologo /labels"' -NoNewWindow -Wait