Tuesday, March 22, 2011

Pipelining in the Export-FIMConfig Cmdlet

It’s no secret I’m a big fan of PowerShell so when FIM ships with some PowerShell cmdlets you know I’m gonna be all over them.  Something kinda surprised me today while toiling around with the Export-FIMConfig cmdlet; it blocks the pipeline.  Cmdlets can return objects to the pipeline immediately, which can be a big performance gain for your script.

I was considering using this cmdlet for the FIM SSRS Data Processing Extension (DPE) because it would buy me all the query functionality I needed in a nice supportable client from Microsoft.  Before even trying this in the DPE I’ve ruled it out because waiting for all the query results would make for a bad interactive report experience – the user would have to wait for all the results before seeing any report results; boo.  Also I don’t know of a way to use the cmdlet to return a subset of attributes which is also important for performance on large reports.

Probably an easy problem to fix.

Also, not really a dead end.  The FIM cmdlets contributed by Quest do not have the same problem.  By looking at the source for their Get-FIMResource cmdlet you can see they’ve implemented the ProcessRecord() method.