Invoke-ProcessDimension Should Accept Pipeline Input - by Aaron Nelson

Status : 


Sign in
to vote
ID 3115034 Comments
Status Active Workarounds
Type Bug Repros 0
Opened 12/7/2016 8:18:05 AM
Access Restriction Public


The following command should just work:
CD SQLSERVER:\SQLAS\LOCALHOST\SQL2016\Databases\AdventureWorksDW2014Multidimensional-EE\Dimensions\;
DIR | Invoke-ProcessDimension -ProcessType ProcessFull;

Unfortunately it produces the following error message: 
"Invoke-ProcessDimension : The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input 
and its properties do not match any of the parameters that take pipeline input."

In addition, to accepting pipeline input, the Invoke-ProcessDimension cmdlet should also be more location-aware.  For example, if I have already to "CD SQLSERVER:\SQLAS\LOCALHOST\SQL2016\Databases\AdventureWorksDW2014Multidimensional-EE\Dimensions\" within the SQL Provider, I should not need to supply the -Database or -Server parameters.

The end result of these two items is that customers are forced to use a much longer command than is really necessary, and may give up in the process.  
CD SQLSERVER:\SQLAS\LOCALHOST\SQL2016\Databases\AdventureWorksDW2014Multidimensional-EE\Dimensions\;
DIR  | %{
Invoke-ProcessDimension -Name $_.Name -Database 'AdventureWorksDW2014Multidimensional-EE' -ProcessType ProcessFull

Oh, and while you're at it, a -ThrottleLimit parameter (similar to Invoke-Command) would be wonderful, that way I can have the command process multiple dimensions at the same time.
Sign in to post a comment.
Posted by Aaron Nelson on 12/20/2016 at 1:59 PM
Also. After the dimensions are processed by Invoke-ProcessDimension, the SSAS PowerShell provider needs to get the updated values for LastProcessed & State. In my testing I am still seeing the old LastProcessed date in the SSAS PowerShell provider, but the updated LastProcessed date in SSMS after I use Invoke-ProcessDimension on a dimension.
Posted by Darren Gosbell on 12/7/2016 at 7:14 PM
You can get the command a little shorter, down to the following, but it's still not great. The cmdlet should be able to handle a collection of dimensions.

DIR | % { $_ | Invoke-ProcessDimension -ProcessType ProcessFull }